next.js
3a20e2ab - [test] Unflake `use-cache-default-profile-expire-zero` tests (#97250)

Commit
32 days ago
[test] Unflake `use-cache-default-profile-expire-zero` tests (#97250) The first assertion in `use-cache-default-profile-expire-zero` retried a full browser reload until the `expire: 0` cache produced a fresh value. In dev that value is served warm across reads, so more than one read is needed, and on a CI runner one of those reloads costs more than the default 3000ms budget can grant a second attempt for. The dev failure reports `waited 3162ms` after a single attempt, in a test that took 15.6s to get there. Neither test asserts anything about the browser: both only read the rendered value and check that the nested-cache error stayed out of the CLI output. Reading the value with `next.render$` brings one attempt down to between 30 and 174ms, so the default budget holds, and it drops two browser launches. The helper rejects a missing element, because the empty string that cheerio yields for one would otherwise satisfy the assertion that the value changed. The test predates #96354, which replaced the try counting in `retry` with a clock. Before that change `retry` granted seven attempts regardless of how long each one took, so a 3s reload was affordable; after it, any attempt over 2500ms consumes the entire budget on its own. #97187 makes the same change for two assertions that were failing this way. [Flakiness metrics][flakiness-metrics] [flakiness-metrics]: https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40git.repository.id%3A%22github.com%2Fvercel%2Fnext.js%22%20%40test.name%3A%22use-cache-default-profile-expire-zero%20treats%20a%20short%20default%20cacheLife%20profile%20as%20a%20dynamic%20hole%2C%20not%20a%20nested-cache%20error%22%20%40test.type%3A%22nextjs%22%20%40test.status%3A%22fail%22&agg_m=count&agg_m_source=base&agg_t=count&fromUser=false&index=citest&start=1785948830138&end=1786553630138&paused=false
Author
Parents
Loading