Skip to content

Commit 17a232b

Browse files
committed
test: delay file modifications to mitigate flaky tests
Introduce a delay in amending files during tests to reduce flakiness.
1 parent 33e3c0b commit 17a232b

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

tests/legacy-cli/e2e/tests/vite/ssr-entry-express.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ async function modifyFileAndWaitUntilUpdated(
137137
): Promise<void> {
138138
await Promise.all([
139139
waitForAnyProcessOutputToMatch(/Page reload sent to client/),
140-
replaceInFile(filePath, searchValue, replaceValue),
140+
setTimeout(100).then(() => replaceInFile(filePath, searchValue, replaceValue)),
141141
]);
142-
143-
await setTimeout(200);
144142
}

tests/legacy-cli/e2e/tests/vite/ssr-entry-fastify.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ async function modifyFileAndWaitUntilUpdated(
137137
): Promise<void> {
138138
await Promise.all([
139139
waitForAnyProcessOutputToMatch(/Page reload sent to client/),
140-
replaceInFile(filePath, searchValue, replaceValue),
140+
setTimeout(100).then(() => replaceInFile(filePath, searchValue, replaceValue)),
141141
]);
142-
143-
await setTimeout(200);
144142
}

tests/legacy-cli/e2e/tests/vite/ssr-entry-h3.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ async function modifyFileAndWaitUntilUpdated(
128128
): Promise<void> {
129129
await Promise.all([
130130
waitForAnyProcessOutputToMatch(/Page reload sent to client/),
131-
replaceInFile(filePath, searchValue, replaceValue),
131+
setTimeout(100).then(() => replaceInFile(filePath, searchValue, replaceValue)),
132132
]);
133-
134-
await setTimeout(200);
135133
}

tests/legacy-cli/e2e/tests/vite/ssr-entry-hono.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ async function modifyFileAndWaitUntilUpdated(
120120
): Promise<void> {
121121
await Promise.all([
122122
waitForAnyProcessOutputToMatch(/Page reload sent to client/),
123-
replaceInFile(filePath, searchValue, replaceValue),
123+
setTimeout(100).then(() => replaceInFile(filePath, searchValue, replaceValue)),
124124
]);
125-
126-
await setTimeout(200);
127125
}

0 commit comments

Comments
 (0)