Skip to content

Commit caecb1a

Browse files
committed
fix(test/jre): bump path-fallback test timeout to 30s for Windows
`falls through to PATH when JAVA_HOME is empty` walks `where java` (Windows) / `which java` (POSIX). Windows CI agents can take >10s to return when the JRE binary is cold-cached, blowing the default 10s per-test timeout. Same shape as the async-which non-existent- binary test fix from db1665d. Bumping to 30s; the test remains tolerant of a `undefined` result (no JRE on PATH), so the assertion is only the `source === 'path'` positive case.
1 parent c26f6b2 commit caecb1a

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

test/unit/external-tools/jre/resolve.test.mts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,22 @@ describe.sequential('external-tools/jre/resolve', () => {
3535
expect(result?.source).toBe('java-home')
3636
})
3737

38-
it('falls through to PATH when JAVA_HOME is empty', async () => {
39-
vi.stubEnv('JAVA_HOME', '')
40-
resetJreResolution()
41-
const result = await resolveJre()
42-
if (result !== undefined) {
43-
expect(result.source).toBe('path')
44-
}
45-
})
38+
// PATH-fallback walks `where java` (Windows) / `which java` (POSIX);
39+
// Windows CI agents can take >10s to return when the cache is cold,
40+
// so bump the per-test timeout to match the async-which non-existent-
41+
// binary fix in test/unit/which.test.mts.
42+
it(
43+
'falls through to PATH when JAVA_HOME is empty',
44+
{ timeout: 30_000 },
45+
async () => {
46+
vi.stubEnv('JAVA_HOME', '')
47+
resetJreResolution()
48+
const result = await resolveJre()
49+
if (result !== undefined) {
50+
expect(result.source).toBe('path')
51+
}
52+
},
53+
)
4654

4755
it('resetJreResolution clears the memo slot', async () => {
4856
vi.stubEnv('JAVA_HOME', '/opt/jdk')

0 commit comments

Comments
 (0)