From 5a9d1f4d5c6c9656b7678dd892f31e3964fe8ee5 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Thu, 3 Apr 2025 17:24:26 +0200 Subject: [PATCH] Fix test that relies on mtimes (#17529) Fixes a timing issue added to a new unit test on `main`. Going to wait for the `CI / Linux` unit tests to pass 3 times before merging this. --- packages/@tailwindcss-postcss/src/index.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/@tailwindcss-postcss/src/index.test.ts b/packages/@tailwindcss-postcss/src/index.test.ts index bf7c0f97a..5827d819d 100644 --- a/packages/@tailwindcss-postcss/src/index.test.ts +++ b/packages/@tailwindcss-postcss/src/index.test.ts @@ -378,7 +378,7 @@ describe('concurrent builds', () => { }) afterEach(() => rm(dir, { recursive: true, force: true })) - test('the current working directory is used by default', async () => { + test('does experience a race-condition when calling the plugin two times for the same change', async () => { const spy = vi.spyOn(process, 'cwd') spy.mockReturnValue(dir) @@ -401,6 +401,8 @@ describe('concurrent builds', () => { expect(result).toContain('.underline') + // Ensure that the mtime is updated + await new Promise((resolve) => setTimeout(resolve, 100)) await writeFile( path.join(dir, 'dependency.css'), css`