From 44dd6da4fee4208637c8653517e30da5b9703b25 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Wed, 4 Sep 2024 17:09:33 +0200 Subject: [PATCH] Integration tests: Fix Windows flake for Vite watch mode (#14332) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 😅 ). --- integrations/vite/index.test.ts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/integrations/vite/index.test.ts b/integrations/vite/index.test.ts index f89cb274f..f37940c2f 100644 --- a/integrations/vite/index.test.ts +++ b/integrations/vite/index.test.ts @@ -317,21 +317,20 @@ import { await fs.expectFileToContain(filename, [candidate`underline`, candidate`flex`]) - await new Promise((resolve) => setTimeout(resolve, 1000)) - - // Updates are additive and cause new candidates to be added. - await fs.write( - 'project-a/index.html', - html` - - - - -
Hello, world!
- - `, - ) await retryAssertion(async () => { + // Updates are additive and cause new candidates to be added. + await fs.write( + 'project-a/index.html', + html` + + + + +
Hello, world!
+ + `, + ) + let files = await fs.glob('project-a/dist/**/*.css') expect(files).toHaveLength(1) let [, css] = files[0]