Skip to content

Commit 44dd6da

Browse files
Integration tests: Fix Windows flake for Vite watch mode (#14332)
I noticed the Windows integration tests for Vite's `watch` mode have been flaky. Moving the file write into the retrying assertion callback seems to fix it and allows us to get rid of the arbitrary timeout (I don't remember that I ever added this in the first place 😅 ).
1 parent 719a535 commit 44dd6da

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

integrations/vite/index.test.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -317,21 +317,20 @@ import {
317317

318318
await fs.expectFileToContain(filename, [candidate`underline`, candidate`flex`])
319319

320-
await new Promise((resolve) => setTimeout(resolve, 1000))
321-
322-
// Updates are additive and cause new candidates to be added.
323-
await fs.write(
324-
'project-a/index.html',
325-
html`
326-
<head>
327-
<link rel="stylesheet" href="./src/index.css" />
328-
</head>
329-
<body>
330-
<div class="underline m-2">Hello, world!</div>
331-
</body>
332-
`,
333-
)
334320
await retryAssertion(async () => {
321+
// Updates are additive and cause new candidates to be added.
322+
await fs.write(
323+
'project-a/index.html',
324+
html`
325+
<head>
326+
<link rel="stylesheet" href="./src/index.css" />
327+
</head>
328+
<body>
329+
<div class="underline m-2">Hello, world!</div>
330+
</body>
331+
`,
332+
)
333+
335334
let files = await fs.glob('project-a/dist/**/*.css')
336335
expect(files).toHaveLength(1)
337336
let [, css] = files[0]

0 commit comments

Comments
 (0)