Skip to content

Commit

Permalink
Abort pending nock requests to prevent flakes.
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Jul 19, 2023
1 parent aaaf668 commit 6e918de
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/node-integration-tests/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,17 @@ export class TestEnv {
// Ex: Remix scope bleed tests.
nock.cleanAll();

void this._closeServer().then(() => {
resolve(envelopes);
});
// Abort all pending requests to nock to prevent hanging / flakes.
// See: https://github.com/nock/nock/issues/1118#issuecomment-544126948
nock.abortPendingRequests();

this._closeServer()
.catch(e => {
logger.warn(e);
})
.finally(() => {
resolve(envelopes);
});
} else {
resolve(envelopes);
}
Expand Down

0 comments on commit 6e918de

Please sign in to comment.