From baaf80b27d812ba147a77ca27452ca96714a777e Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 24 Jul 2023 15:49:29 +0800 Subject: [PATCH] Fix prerender getStaticPaths flaky test (#7745) --- packages/astro/test/ssr-prerender-get-static-paths.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/astro/test/ssr-prerender-get-static-paths.test.js b/packages/astro/test/ssr-prerender-get-static-paths.test.js index 08e3060f05..391e7485dd 100644 --- a/packages/astro/test/ssr-prerender-get-static-paths.test.js +++ b/packages/astro/test/ssr-prerender-get-static-paths.test.js @@ -59,7 +59,11 @@ describe('Prerender', () => { await devServer.stop(); }); - it('only calls prerender getStaticPaths once', async () => { + it('only calls prerender getStaticPaths once', async function () { + // Sometimes this fail in CI as the chokidar watcher triggers an update and invalidates the route cache, + // causing getStaticPaths to be called twice. Workaround this with 2 retries for now. + this.retries(2); + let res = await fixture.fetch('/blog/a'); expect(res.status).to.equal(200);