Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(ci): retry jest failures and preserve attempts for trunk (#101769)

Paul D'Ambrafbc9fc94a9e3
diff --git a/.github/scripts/jest-retries.cjs b/.github/scripts/jest-retries.cjs
new file mode 100644
index 000000000000..32e94f7e2dbc
--- /dev/null
+++ b/.github/scripts/jest-retries.cjs
@@ -0,0 +1,3 @@
+if (process.env.CI) {
+ jest.retryTimes(1, { logErrorsBeforeRetry: true })
+}
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.yml
index 0b1dffaf6747..5a6c42e41d3a 100644
--- a/.github/workflows/ci-e2e-playwright.yml
+++ b/.github/workflows/ci-e2e-playwright.yml
@@ -1119,7 +1119,7 @@ jobs:
with:
junit-paths: playwright/junit-results.xml
org-slug: posthog-inc
- cli-version: '0.13.7'
+ cli-version: '0.15.4'
quarantine: true
previous-step-outcome: ${{ steps.playwright-tests.outcome }}
token: ${{ secrets.TRUNK_API_TOKEN }}
diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml
index 1f97c36622d6..703dc3673043 100644
--- a/.github/workflows/ci-frontend.yml
+++ b/.github/workflows/ci-frontend.yml
@@ -118,6 +118,8 @@ jobs:
- 'products/**/*.ts'
- 'products/**/*.tsx'
frontend:
+ - '.github/scripts/jest-retries.cjs'
+ - 'patches/[email protected]'
# Avoid running frontend tests for irrelevant changes
# NOTE: we are at risk of missing a dependency here.
- 'bin/**'
@@ -163,6 +165,8 @@ jobs:
# compiled output — used to skip Jest, bundle-size, and TypeScript checks
# when only markdown or YAML files change.
frontend_code:
+ - '.github/scripts/jest-retries.cjs'
+ - 'patches/[email protected]'
- 'bin/**'
- 'frontend/**'
- 'ee/frontend/**'
@@ -199,6 +203,8 @@ jobs:
# lockfile and have broken it before (rrweb subpath entries switching
# to ESM); its zstd tests need the node:zlib support pinned by .nvmrc.
replay_shared:
+ - '.github/scripts/jest-retries.cjs'
+ - 'patches/[email protected]'
- 'common/replay-shared/**'
- pnpm-workspace.yaml
- pnpm-lock.yaml
@@ -343,7 +349,7 @@ jobs:
case "$f" in
jest.*.ts|babel.config.js|tsconfig.json|tsconfig.*.json|\
package.json|pnpm-lock.yaml|webpack.config.js|\
- .github/workflows/ci-frontend.yml|.nvmrc)
+ .github/workflows/ci-frontend.yml|.github/scripts/jest-retries.cjs|patches/[email protected]|.nvmrc)
fall_back config_change "$f"
exit 0
;;
diff --git a/.github/workflows/ci-nodejs.yml b/.github/workflows/ci-nodejs.yml
index 43ab8ba9e1f7..031377347514 100644
--- a/.github/workflows/ci-nodejs.yml
+++ b/.github/workflows/ci-nodejs.yml
@@ -79,6 +79,8 @@ jobs:
list-files: 'escape'
filters: |
nodejs:
+ - '.github/scripts/jest-retries.cjs'
+ - 'patches/[email protected]'
- .github/workflows/ci-nodejs.yml
- .github/actions/setup-uv/**
# The report job executes these after Jest uploads its JUnit artifacts.
@@ -127,6 +129,8 @@ jobs:
# Anything here invalidates jest's view of the module graph, or changes
# the native addons every suite links, so no narrowed run can be trusted.
node_full:
+ - '.github/scripts/jest-retries.cjs'
+ - 'patches/[email protected]'
- 'nodejs/jest*.config.js'
- 'nodejs/package.json'
- 'nodejs/tsconfig*.json'
diff --git a/.github/workflows/ci-storybook.yml b/.github/workflows/ci-storybook.yml
index 30d6e986a6e3..cb8203b5f18a 100644
--- a/.github/workflows/ci-storybook.yml
+++ b/.github/workflows/ci-storybook.yml
@@ -104,6 +104,7 @@ jobs:
token: ${{ steps.app-token.outputs.token || github.token }}
filters: |
frontend:
+ - 'patches/[email protected]'
- 'frontend/**'
- 'products/**/*.{ts,tsx}'
- 'products/**/frontend/**'
diff --git a/common/replay-shared/jest.config.js b/common/replay-shared/jest.config.js
index 8a8a02feb4e6..25ba21ecd922 100644
--- a/common/replay-shared/jest.config.js
+++ b/common/replay-shared/jest.config.js
@@ -6,7 +6,7 @@ module.exports = {
transformIgnorePatterns: ['node_modules/(?!.*posthog-js/dist/rrweb)'],
testEnvironment: 'node',
// Wraps the describe/it/test globals to enforce .test_quarantine.json jest entries.
- setupFilesAfterEnv: ['../../frontend/jest.quarantine.ts'],
+ setupFilesAfterEnv: ['../../frontend/jest.quarantine.ts', '../../.github/scripts/jest-retries.cjs'],
clearMocks: true,
testMatch: ['<rootDir>/src/**/*.test.ts'],
// CI sets JEST_JUNIT_OUTPUT_DIR to collect junit for the Trunk quarantine gate.
diff --git a/docs/internal/ci-test-retries.md b/docs/internal/ci-test-retries.md
new file mode 100644
index 000000000000..2c986739cc0b
--- /dev/null
+++ b/docs/internal/ci-test-retries.md
@@ -0,0 +1,48 @@
+# CI retries and Trunk
+
+Retry failed tests in the test runner and retain each failed attempt in the uploaded JUnit report.
+A passing retry can pass CI.
+A test that fails its retry must still fail the test command.
+The existing Trunk gate can clear failures for quarantined tests.
+An upload failure does not turn a failed test command into a pass.
+
+## Suites connected to Trunk
+
+| Suite | Retry budget | Failed-attempt report |
+| ----------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
+| Backend pytest: core, Temporal, products | One in CI | Separate JUnit reports retain failed attempts; see [PR #101493](https://github.com/PostHog/posthog/pull/101493) |
+| Frontend Jest, Node.js Jest, replay-shared Jest | One in CI | Shared setup enables error recording; patched `jest-junit` emits retry children |
+| Storybook | Two, as configured by its test runner | Patched `jest-junit` emits retry children |
+| Playwright E2E | One in normal CI; zero in the audit workflow | Built-in JUnit reporter with `includeRetries: true` |
+| Rust nextest | One in the CI profile | Built-in JUnit retry children |
+
+Jest retries after the other tests in the file.
+Local Jest commands do not enable the shared CI retry setting.
+Existing suite-specific overrides still apply.
+
+The `jest-junit` patch preserves the existing test names, file paths, counts, and final results.
+It adds `flakyFailure` for a passing retry and `rerunFailure` for earlier attempts when the final attempt fails.
+`logErrorsBeforeRetry: true` is required so Jest retains `retryReasons` for the reporter.
+
+Trunk CLI 0.15.4 is pinned in the shared upload action and the inline Playwright upload step.
+Its [parser and regression tests](https://github.com/trunk-io/analytics-cli/blob/0.15.4/context/src/junit/parser.rs) retain retry children as separate attempts.
+The published [Trunk Playwright guide](https://docs.trunk.io/flaky-tests/get-started/frameworks/playwright) and [pytest guide](https://docs.trunk.io/flaky-tests/get-started/frameworks/pytest) still recommend disabling retries.
+Use the released parser behavior and validate the actual report when a runner changes.
+
+## Validation and rollout
+
+Use a temporary test that fails once and then passes, plus a test that fails every attempt.
+Check the command exit code and the XML for both cases.
+Run `trunk-analytics-cli validate --junit-paths '<report path>'` before uploading; this command does not upload data.
+The [Playwright reporter reference](https://playwright.dev/docs/test-reporters#junit-reporter) and [nextest retry reference](https://nexte.st/docs/features/retries/) describe their report settings.
+
+After merge, inspect one recovered test from each suite in Trunk.
+Confirm that it has both a failed and a passed attempt under the same identity.
+Check the existing Engineering analytics attempt counts and recovered-test outcomes.
+Track quarantine growth and CI failures after the change: more visible retry failures can produce more quarantine decisions.
+
+## Other test jobs
+
+This configuration covers the suites with Trunk upload gates.
+Standalone Vitest jobs, Go jobs, Rust doctests, and separate desktop workflows need their own report and exit-code checks before adopting the same policy.
+Lint, type checks, builds, test discovery errors, and process crashes do not receive a test retry.
diff --git a/frontend/bin/junitRetries.test.ts b/frontend/bin/junitRetries.test.ts
new file mode 100644
index 000000000000..a51462de4403
--- /dev/null
+++ b/frontend/bin/junitRetries.test.ts
@@ -0,0 +1,59 @@
+/** @jest-environment-options {"customExportConditions":["node","node-addons"]} */
+// jsdom resolves uuid to an ESM browser build, while jest-junit runs under Node in CI.
+
+import { mkdtempSync, readFileSync, rmSync } from 'fs'
+import { tmpdir } from 'os'
+import { join } from 'path'
+
+const JestJUnit = require('jest-junit')
+
+describe('JUnit retry reports', () => {
+ test.each([
+ ['passed', [], undefined],
+ ['passed', ['first attempt <failed>'], 'flakyFailure'],
+ ['failed', ['first attempt <failed>'], 'rerunFailure'],
+ ])('reports %s with retry evidence %j', (status, retryReasons, retryTag) => {
+ const directory = mkdtempSync(join(tmpdir(), 'junit-retries-'))
+ const originalEnvironment = process.env
+ process.env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.startsWith('JEST_JUNIT_')))
+ try {
+ const reporter = new JestJUnit(
+ { rootDir: directory },
+ { outputDirectory: directory, outputName: 'junit.xml' }
+ )
+ reporter.onRunComplete(new Set(), {
+ startTime: Date.now(),
+ testResults: [
+ {
+ testFilePath: join(directory, 'example.test.js'),
+ perfStats: { start: Date.now(), end: Date.now() },
+ numFailingTests: status === 'failed' ? 1 : 0,
+ numPassingTests: status === 'passed' ? 1 : 0,
+ numPendingTests: 0,
+ testResults: [
+ {
+ ancestorTitles: ['example'],
+ title: 'retries',
+ duration: 1,
+ status,
+ retryReasons,
+ failureMessages: status === 'failed' ? ['final failure'] : [],
+ },
+ ],
+ },
+ ],
+ })
+ const report = readFileSync(join(directory, 'junit.xml'), 'utf8')
+ expect(report.match(/<testcase\s/g)).toHaveLength(1)
+ expect(report.includes('<failure>')).toBe(status === 'failed')
+ if (retryTag) {
+ expect(report).toContain(`<${retryTag}>first attempt &lt;failed&gt;</${retryTag}>`)
+ } else {
+ expect(report).not.toMatch(/<(flaky|rerun)Failure>/)
+ }
+ } finally {
+ process.env = originalEnvironment
+ rmSync(directory, { recursive: true, force: true })
+ }
+ })
+})
diff --git a/frontend/jest.config.ts b/frontend/jest.config.ts
index 497c8acb52be..8d1f0e4c5f0c 100644
--- a/frontend/jest.config.ts
+++ b/frontend/jest.config.ts
@@ -284,6 +284,7 @@ const config: Config = {
// jest.quarantine.ts first so it wraps the describe/it/test globals before any test file declares tests.
setupFilesAfterEnv: [
'<rootDir>/jest.quarantine.ts',
+ '<rootDir>/../.github/scripts/jest-retries.cjs',
'<rootDir>/jest.setupAfterEnv.ts',
'<rootDir>/src/mocks/jest.ts',
],
diff --git a/nodejs/jest.config.shared.js b/nodejs/jest.config.shared.js
index 97776bd5c4ad..af1a13439cf2 100644
--- a/nodejs/jest.config.shared.js
+++ b/nodejs/jest.config.shared.js
@@ -14,7 +14,7 @@ module.exports = {
coverageProvider: 'v8',
setupFiles: ['./jest.setup-env.ts'],
// jest.quarantine.ts first so it wraps the describe/it/test globals before any test file declares tests.
- setupFilesAfterEnv: ['../frontend/jest.quarantine.ts', './jest.setup.ts'],
+ setupFilesAfterEnv: ['../frontend/jest.quarantine.ts', '../.github/scripts/jest-retries.cjs', './jest.setup.ts'],
testTimeout: 60000,
// The image-scrub sidecar is a standalone package with its own jest run; keep the plugin-server suite out of it.
modulePathIgnorePatterns: [
diff --git a/nodejs/src/cdp/services/hogflows/hogflow-duplicate-observer.service.test.ts b/nodejs/src/cdp/services/hogflows/hogflow-duplicate-observer.service.test.ts
index 2b13f7bc6daa..63e58255d5e9 100644
--- a/nodejs/src/cdp/services/hogflows/hogflow-duplicate-observer.service.test.ts
+++ b/nodejs/src/cdp/services/hogflows/hogflow-duplicate-observer.service.test.ts
@@ -30,7 +30,7 @@ const dupCounterValue = async (workflowId: string): Promise<number> => {
}
describe('HogFlowDuplicateObserverService', () => {
- jest.retryTimes(3)
+ jest.retryTimes(3, { logErrorsBeforeRetry: true })
let hub: Hub
let redis: RedisV2
diff --git a/nodejs/src/cdp/services/monitoring/hog-masker.service.test.ts b/nodejs/src/cdp/services/monitoring/hog-masker.service.test.ts
index db2e849b1b8c..28940152b92d 100644
--- a/nodejs/src/cdp/services/monitoring/hog-masker.service.test.ts
+++ b/nodejs/src/cdp/services/monitoring/hog-masker.service.test.ts
@@ -16,7 +16,7 @@ import { BASE_REDIS_KEY, HogMaskerService } from './hog-masker.service'
const mockNow: jest.SpyInstance = jest.spyOn(Date, 'now')
describe('HogMasker', () => {
- jest.retryTimes(3)
+ jest.retryTimes(3, { logErrorsBeforeRetry: true })
describe('integration', () => {
let now: number
let hub: Hub
diff --git a/nodejs/src/cdp/services/rate-limiter/rate-limiter.service.test.ts b/nodejs/src/cdp/services/rate-limiter/rate-limiter.service.test.ts
index 3feefc2b4f05..490f0fee49ef 100644
--- a/nodejs/src/cdp/services/rate-limiter/rate-limiter.service.test.ts
+++ b/nodejs/src/cdp/services/rate-limiter/rate-limiter.service.test.ts
@@ -11,7 +11,7 @@ import { RateLimiterService } from './rate-limiter.service'
const KEY = `@posthog-test/ses-rate-limiter/${randomUUID()}/bucket`
describe('RateLimiterService', () => {
- jest.retryTimes(3)
+ jest.retryTimes(3, { logErrorsBeforeRetry: true })
let hub: Hub
let redis: RedisV2
diff --git a/nodejs/src/common/api/router.test.ts b/nodejs/src/common/api/router.test.ts
index fd8615cc040f..cbe4819cc47d 100644
--- a/nodejs/src/common/api/router.test.ts
+++ b/nodejs/src/common/api/router.test.ts
@@ -5,7 +5,7 @@ import { IngestionGeneralServer } from '~/servers/ingestion-general-server'
import { TEST_KAFKA_TOPICS, ensureKafkaTopics } from '~/tests/helpers/kafka'
describe('router', () => {
- jest.retryTimes(3) // Flakey due to reliance on kafka/clickhouse
+ jest.retryTimes(3, { logErrorsBeforeRetry: true }) // Flakey due to reliance on kafka/clickhouse
let server: IngestionGeneralServer
beforeAll(async () => {
diff --git a/nodejs/src/common/services/keyed-rate-limiter.service.test.ts b/nodejs/src/common/services/keyed-rate-limiter.service.test.ts
index fb46c3306c83..1b652c405e31 100644
--- a/nodejs/src/common/services/keyed-rate-limiter.service.test.ts
+++ b/nodejs/src/common/services/keyed-rate-limiter.service.test.ts
@@ -8,7 +8,7 @@ import { KeyedRateLimiterService } from './keyed-rate-limiter.service'
const mockNow: jest.SpyInstance = jest.spyOn(Date, 'now')
describe('KeyedRateLimiterService', () => {
- jest.retryTimes(3)
+ jest.retryTimes(3, { logErrorsBeforeRetry: true })
let now: number
let hub: Hub
diff --git a/nodejs/src/common/utils/request.test.ts b/nodejs/src/common/utils/request.test.ts
index 7758ad63c928..1db8d5715cc6 100644
--- a/nodejs/src/common/utils/request.test.ts
+++ b/nodejs/src/common/utils/request.test.ts
@@ -250,7 +250,7 @@ describe('fetch', () => {
})
describe('parallel requests execution', () => {
- jest.retryTimes(3)
+ jest.retryTimes(3, { logErrorsBeforeRetry: true })
// NOTE: This is inherently flakey so we disable it except when validating changes for it
it.skip('should execute requests in parallel - completion time test', async () => {
const delayMs = 200
@@ -340,7 +340,7 @@ describe('legacyFetch', () => {
// NOTE: Skipped as this is mostly to validate against the new request implementation
describe.skip('parallel requests execution', () => {
- jest.retryTimes(3)
+ jest.retryTimes(3, { logErrorsBeforeRetry: true })
it('should execute requests in parallel', async () => {
const start = performance.now()
const timings: number[] = []
diff --git a/nodejs/src/logs/services/logs-rate-limiter.service.test.ts b/nodejs/src/logs/services/logs-rate-limiter.service.test.ts
index f4404fe86212..1a033594a399 100644
--- a/nodejs/src/logs/services/logs-rate-limiter.service.test.ts
+++ b/nodejs/src/logs/services/logs-rate-limiter.service.test.ts
@@ -8,7 +8,7 @@ import { BASE_REDIS_KEY, LogsRateLimiterService, logsMessageLagHistogram } from
const mockNow: jest.SpyInstance = jest.spyOn(Date, 'now')
describe('LogsRateLimiterService', () => {
- jest.retryTimes(3)
+ jest.retryTimes(3, { logErrorsBeforeRetry: true })
const LOGS_LIMITER_BUCKET_SIZE_KB = 100
const BUCKET_EXCEEDED_UNCOMPRESSED_BYTES = 15360
diff --git a/nodejs/tests/ingestion-general-server.serial.test.ts b/nodejs/tests/ingestion-general-server.serial.test.ts
index a7bd3194ea69..383122dbe648 100644
--- a/nodejs/tests/ingestion-general-server.serial.test.ts
+++ b/nodejs/tests/ingestion-general-server.serial.test.ts
@@ -14,7 +14,7 @@ import { resetTestDatabase } from './helpers/sql'
jest.setTimeout(20000) // 20 sec timeout - longer indicates an issue
describe('ingestion general server', () => {
- jest.retryTimes(3) // Flakey due to reliance on kafka/clickhouse
+ jest.retryTimes(3, { logErrorsBeforeRetry: true }) // Flakey due to reliance on kafka/clickhouse
let server: IngestionGeneralServer | null = null
beforeAll(async () => {
diff --git a/nodejs/tests/ingestion-logs-server.serial.test.ts b/nodejs/tests/ingestion-logs-server.serial.test.ts
index e37e667ec998..b90678593014 100644
--- a/nodejs/tests/ingestion-logs-server.serial.test.ts
+++ b/nodejs/tests/ingestion-logs-server.serial.test.ts
@@ -6,7 +6,7 @@ import { resetTestDatabase } from './helpers/sql'
jest.setTimeout(20000) // 20 sec timeout - longer indicates an issue
describe('ingestion logs server', () => {
- jest.retryTimes(3) // Flakey due to reliance on kafka/clickhouse
+ jest.retryTimes(3, { logErrorsBeforeRetry: true }) // Flakey due to reliance on kafka/clickhouse
let server: IngestionLogsServer | null = null
beforeEach(async () => {
diff --git a/nodejs/tests/ingestion-session-replay-server.serial.test.ts b/nodejs/tests/ingestion-session-replay-server.serial.test.ts
index 06991aabdfac..7afdb56cb6e9 100644
--- a/nodejs/tests/ingestion-session-replay-server.serial.test.ts
+++ b/nodejs/tests/ingestion-session-replay-server.serial.test.ts
@@ -6,7 +6,7 @@ import { resetTestDatabase } from './helpers/sql'
jest.setTimeout(20000) // 20 sec timeout - longer indicates an issue
describe('ingestion session replay server', () => {
- jest.retryTimes(3) // Flakey due to reliance on kafka/clickhouse
+ jest.retryTimes(3, { logErrorsBeforeRetry: true }) // Flakey due to reliance on kafka/clickhouse
let server: IngestionSessionReplayServer | null = null
beforeEach(async () => {
diff --git a/nodejs/tests/ingestion-traces-server.serial.test.ts b/nodejs/tests/ingestion-traces-server.serial.test.ts
index 040273384c19..1567a24e4cb9 100644
--- a/nodejs/tests/ingestion-traces-server.serial.test.ts
+++ b/nodejs/tests/ingestion-traces-server.serial.test.ts
@@ -6,7 +6,7 @@ import { resetTestDatabase } from './helpers/sql'
jest.setTimeout(20000) // 20 sec timeout - longer indicates an issue
describe('ingestion traces server', () => {
- jest.retryTimes(3) // Flakey due to reliance on kafka/clickhouse
+ jest.retryTimes(3, { logErrorsBeforeRetry: true }) // Flakey due to reliance on kafka/clickhouse
let server: IngestionTracesServer | null = null
beforeEach(async () => {
diff --git a/nodejs/tests/ingestion/postgres-parity.test.ts b/nodejs/tests/ingestion/postgres-parity.test.ts
index 2294e48e1a60..22ad210de0c9 100644
--- a/nodejs/tests/ingestion/postgres-parity.test.ts
+++ b/nodejs/tests/ingestion/postgres-parity.test.ts
@@ -89,7 +89,7 @@ const extraServerConfig: Partial<PluginsServerConfig> = {
}
describe('postgres parity', () => {
- jest.retryTimes(1) // Reduced from 5 to limit timeout amplification when kafka/clickhouse is degraded
+ jest.retryTimes(1, { logErrorsBeforeRetry: true }) // Reduced from 5 to limit timeout amplification when kafka/clickhouse is degraded
let postgres: PostgresRouter
let kafkaProducer: KafkaProducerWrapper
let server: IngestionGeneralServer
diff --git a/nodejs/tests/logs/sampling/logs-sampling.rate-limit-impact.integration.test.ts b/nodejs/tests/logs/sampling/logs-sampling.rate-limit-impact.integration.test.ts
index 854db3ddb5db..c3830cc9ce0b 100644
--- a/nodejs/tests/logs/sampling/logs-sampling.rate-limit-impact.integration.test.ts
+++ b/nodejs/tests/logs/sampling/logs-sampling.rate-limit-impact.integration.test.ts
@@ -89,7 +89,7 @@ function logRow(uuid: string, bytesUncompressed: number): LogRecord {
}
describe('logs drop-rule rate limit — save-to-impact', () => {
- jest.retryTimes(3)
+ jest.retryTimes(3, { logErrorsBeforeRetry: true })
let hub: Hub
let redis: RedisV2
diff --git a/nodejs/tests/server.serial.test.ts b/nodejs/tests/server.serial.test.ts
index dea23ca5ac4b..f803a9721218 100644
--- a/nodejs/tests/server.serial.test.ts
+++ b/nodejs/tests/server.serial.test.ts
@@ -6,7 +6,7 @@ import { resetTestDatabase } from './helpers/sql'
jest.setTimeout(20000) // 20 sec timeout - longer indicates an issue
describe('server', () => {
- jest.retryTimes(3) // Flakey due to reliance on kafka/clickhouse
+ jest.retryTimes(3, { logErrorsBeforeRetry: true }) // Flakey due to reliance on kafka/clickhouse
let pluginsServer: PluginServer | null = null
beforeEach(async () => {
diff --git a/patches/[email protected] b/patches/[email protected]
new file mode 100644
index 000000000000..866bd5c159d3
--- /dev/null
+++ b/patches/[email protected]
@@ -0,0 +1,16 @@
+diff --git a/utils/buildJsonResults.js b/utils/buildJsonResults.js
+index 46d2378fb08287b3f8b190a824bd30f63ad19c91..1de3a1bd2dd394d515d61a87ab8ca3ba0aa9d362 100644
+--- a/utils/buildJsonResults.js
++++ b/utils/buildJsonResults.js
+@@ -80,6 +80,11 @@ const generateTestCase = function(junitOptions, suiteOptions, tc, filepath, file
+ testCase.testcase[0]._attr.file = filepath;
+ }
+
++ const retryTag = tc.status === 'passed' ? 'flakyFailure' : 'rerunFailure';
++ (tc.retryReasons || []).forEach((failure) => {
++ testCase.testcase.push({ [retryTag]: strip(failure) });
++ });
++
+ // Write out all failure messages as <failure> tags
+ // Nested underneath <testcase> tag
+ if (tc.status === testFailureStatus || tc.status === testErrorStatus) {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 9613a8b20cbd..fb8e91c40299 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -201,6 +201,9 @@ patchedDependencies:
hash: c51d4e8d9f649ee8a8e61577347ca1e4a9da029e91a073a91aae08ebf783d5d2
path: patches/[email protected]
+ hash: b78c8d985264045675ad1405ea3773eb504f97e0725f24ed35bd348f66d41811
+ path: patches/[email protected]
hash: 139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5
path: patches/[email protected]
@@ -471,7 +474,7 @@ importers:
jest-junit:
specifier: 'catalog:'
- version: 16.0.0
+ version: 16.0.0(patch_hash=b78c8d985264045675ad1405ea3773eb504f97e0725f24ed35bd348f66d41811)
common/storybook:
dependencies:
@@ -1415,7 +1418,7 @@ importers:
jest-junit:
specifier: ^16.0.0
- version: 16.0.0
+ version: 16.0.0(patch_hash=b78c8d985264045675ad1405ea3773eb504f97e0725f24ed35bd348f66d41811)
kea-typegen:
specifier: 3.8.3
version: 3.8.3([email protected])
@@ -1870,7 +1873,7 @@ importers:
version: 30.0.5
jest-junit:
specifier: ^16.0.0
- version: 16.0.0
+ version: 16.0.0(patch_hash=b78c8d985264045675ad1405ea3773eb504f97e0725f24ed35bd348f66d41811)
oxlint:
specifier: 1.72.0
version: 1.72.0([email protected])
@@ -32002,7 +32005,7 @@ snapshots:
jest-circus: 30.0.5
jest-environment-node: 30.0.5
- jest-junit: 16.0.0
+ jest-junit: 16.0.0(patch_hash=b78c8d985264045675ad1405ea3773eb504f97e0725f24ed35bd348f66d41811)
jest-process-manager: 0.4.0
jest-runner: 30.0.5
jest-serializer-html: 7.1.0
@@ -39131,7 +39134,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ [email protected](patch_hash=b78c8d985264045675ad1405ea3773eb504f97e0725f24ed35bd348f66d41811):
dependencies:
mkdirp: 1.0.4
strip-ansi: 6.0.1
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 94668063a72e..92ab7d756dea 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -102,6 +102,7 @@ overrides:
'@tiptap/extension-underline': 3.20.6
patchedDependencies:
'@connectrpc/[email protected]': patches/@[email protected]