Skip to content

Commit

Permalink
Tests: reduced flakiness by giving the FS a little bit more time to s…
Browse files Browse the repository at this point in the history
…ettle before prodding it again
  • Loading branch information
fabiospampinato committed Sep 15, 2024
1 parent 3950236 commit 4207534
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import exec from "nanoexec";
import fs from "node:fs/promises";
import path from "node:path";
import process from "node:process";
import { setTimeout as delay } from "node:timers/promises";
import Base64 from "radix64-encoding";

import { expect, test } from "@jest/globals";
Expand All @@ -20,7 +21,8 @@ const FIXTURES_PATH = path.join(ROOT_PATH, "test", "__fixtures__");
async function getArchive(folderPath) {
const packPrev = await Archive.pack(folderPath);
const archive = {
getPack: once(() => {
getPack: once(async () => {
await delay(100); // Giving a little time for the FS to settle
return Archive.pack(folderPath);
}),
getChanged: once(async () => {
Expand Down

0 comments on commit 4207534

Please sign in to comment.