test(server): stop timing-dependent failures on busy ci runners
- raise the jest test timeout to 30s: building the nest app in beforeAll can exceed the 5s default when all suites start at once - accept any run status when reading back a just-created run, since the scheduler may already have picked it up
This commit is contained in:
1 parent
cafc126d1b
commit
531754c3fa
2 files changed
+8
-1
No files matched your search
@@ -12,4 +12,8 @@ module.exports = {
|
||||
'^@mozilla/readability$': '<rootDir>/test/__mocks__/readability.ts',
|
||||
},
|
||||
testEnvironment: 'node',
|
||||
// Each suite builds a full Nest app in beforeAll. That takes well under a
|
||||
// second on an idle machine, but several seconds when every suite starts at
|
||||
// once on a busy CI runner, past Jest's default 5 s.
|
||||
testTimeout: 30_000,
|
||||
};
|
||||
@@ -810,7 +810,10 @@ describe("ScenarioController", () => {
|
||||
.expect(200);
|
||||
|
||||
expect(res.body.id).toBe(runId);
|
||||
expect(res.body.status).toBe("pending");
|
||||
// The scheduler may already have picked the run up
|
||||
expect(["pending", "in_progress", "pass", "fail"]).toContain(
|
||||
res.body.status,
|
||||
);
|
||||
expect(Array.isArray(res.body.stepRuns)).toBe(true);
|
||||
expect(res.body.stepRuns[0]).toHaveProperty("scenarioStep");
|
||||
expect(Array.isArray(res.body.logs)).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user