turbo
ba2a8309 - fix: Address root causes of 9 flaky tests and remove retry workarounds (#12045)

Commit
1 day ago
fix: Address root causes of 9 flaky tests and remove retry workarounds (#12045) ## Summary Fixes the root causes of all 9 tests that had `retries = 5` in `nextest.toml`, replacing retry workarounds with actual fixes. ## Changes by test **retry::handles_too_many_failures** - The 10ms request timeout was too tight for loaded CI machines, causing httpmock to not register requests before the timeout fires. Increased to 500ms and dropped the unreliable mock call count assertion. **run/continue** - The 4th test case runs parallel tasks whose output interleaved non-deterministically in stream mode. Added `--log-order=grouped` to all commands. Also replaced hardcoded task hashes and npm-version-specific error messages with regex patterns that work across npm versions. **other/affected** - Replaced 4 hardcoded task hashes with `[0-9a-f]+` regex. Hash values varied across environments because they depend on exact file contents, jq formatting, and npm version. **lockfile-aware-caching/{bun,npm,berry}** - Added `corepack enable` to `lockfile-aware-caching/setup.sh` so each test uses the exact package manager version declared in its fixture's `package.json`. Previously, the system's default version would run, producing output that didn't match test expectations. Corepack doesn't support bun, so it's skipped for bun fixtures. **lockfile-aware-caching/new-package** - This test has an irreducible network dependency (`pnpm install`). Suppressed the exit code from pnpm install and redirected turbo's stderr to avoid non-deterministic warnings in output. **run/unnamed-packages + all prysk tests** - Isolated `COREPACK_HOME` to a shared directory under `turborepo-tests/integration/`, preventing parallel nextest workers from racing on the global `~/.node/corepack` cache. **prune_test::test_prune_composable_config** - Replaced retries with a 120s slow-timeout. The flakiness was a timeout issue from network-dependent setup (corepack download + pnpm install). ## nextest.toml All 9 `retries = 5` overrides removed. Two tests with irreducible network dependency get `slow-timeout` instead. ## Testing All affected tests pass locally. The CI-specific fixes (corepack isolation, grouped log order, regex patterns) target the environmental differences that cause failures in CI.
Author
Parents
Loading