Skip to content

Commit da3fb2b

Browse files
committed
Change waitUntil timeouts to 1 second
1 parent 34c99fa commit da3fb2b

File tree

1 file changed

+40
-60
lines changed
  • fixtures/vitest-pool-workers-examples/workflows/test

1 file changed

+40
-60
lines changed

fixtures/vitest-pool-workers-examples/workflows/test/unit.test.ts

Lines changed: 40 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import {
1414
} from "vitest";
1515

1616
const INSTANCE_ID = "12345678910";
17-
let instance: Awaited<ReturnType<typeof introspectWorkflowInstance>>;
18-
1917
const STEP_NAME = "my step";
2018

2119
describe("Long Workflow instance creation unit tests", () => {
20+
let instance: Awaited<ReturnType<typeof introspectWorkflowInstance>>;
21+
2222
beforeEach(async () => {
2323
instance = await introspectWorkflowInstance(
2424
env.TEST_LONG_WORKFLOW,
@@ -46,9 +46,9 @@ describe("Long Workflow instance creation unit tests", () => {
4646
return (await createdInstance.status()).status === "complete";
4747
},
4848
{
49-
// running under 50ms confirms that sleeps were disabled
50-
timeout: 50,
51-
interval: 50,
49+
// running under a second confirms that sleeps were disabled
50+
timeout: 1000,
51+
interval: 1000,
5252
}
5353
);
5454
});
@@ -116,10 +116,8 @@ describe("Long Workflow instance creation unit tests", () => {
116116
return (await createdInstance.status()).status === "errored";
117117
},
118118
{
119-
// config has 5 retires, all 50ms appart
120-
// should run in a bit over 250ms
121-
timeout: 300,
122-
interval: 300,
119+
timeout: 1000,
120+
interval: 1000,
123121
}
124122
);
125123
});
@@ -145,10 +143,8 @@ describe("Long Workflow instance creation unit tests", () => {
145143
return (await createdInstance.status()).status === "complete";
146144
},
147145
{
148-
// config has 5 retires, all 50ms appart
149-
// with 2 retires, should run in a bit over 100ms
150-
timeout: 150,
151-
interval: 150,
146+
timeout: 1000,
147+
interval: 1000,
152148
}
153149
);
154150
});
@@ -172,10 +168,8 @@ describe("Long Workflow instance creation unit tests", () => {
172168
return (await createdInstance.status()).status === "errored";
173169
},
174170
{
175-
// config has 5 retires, all 50ms appart
176-
// should run in a bit over 250ms
177-
timeout: 300,
178-
interval: 300,
171+
timeout: 1000,
172+
interval: 1000,
179173
}
180174
);
181175
});
@@ -201,10 +195,8 @@ describe("Long Workflow instance creation unit tests", () => {
201195
return (await createdInstance.status()).status === "complete";
202196
},
203197
{
204-
// config has 5 retires, all 50ms appart
205-
// should run in a bit over 50ms
206-
timeout: 100,
207-
interval: 100,
198+
timeout: 1000,
199+
interval: 1000,
208200
}
209201
);
210202
});
@@ -231,10 +223,8 @@ describe("Long Workflow instance creation unit tests", () => {
231223
return (await createdInstance.status()).status === "complete";
232224
},
233225
{
234-
// config has 5 retires, all 50ms appart
235-
// should run in a bit over 100ms
236-
timeout: 150,
237-
interval: 150,
226+
timeout: 1000,
227+
interval: 1000,
238228
}
239229
);
240230
});
@@ -256,9 +246,9 @@ describe("Long Workflow instance creation unit tests", () => {
256246
return (await createdInstance.status()).status === "complete";
257247
},
258248
{
259-
// running under 50ms confirms that the event was moked (and sleeps were disabled)
260-
timeout: 50,
261-
interval: 50,
249+
// running under a second confirms that the event was moked (and sleeps were disabled)
250+
timeout: 1000,
251+
interval: 1000,
262252
}
263253
);
264254
});
@@ -280,9 +270,9 @@ describe("Long Workflow instance creation unit tests", () => {
280270
return (await createdInstance.status()).status === "errored";
281271
},
282272
{
283-
// running under 50ms confirms that the event was forced to time out (and sleeps were disabled)
284-
timeout: 50,
285-
interval: 50,
273+
// running under a second confirms that the event was forced to time out (and sleeps were disabled)
274+
timeout: 1000,
275+
interval: 1000,
286276
}
287277
);
288278
});
@@ -354,9 +344,9 @@ describe("Long Workflow BATCH creation unit tests", () => {
354344
).every((s) => s.status === "complete");
355345
},
356346
{
357-
// running under 100ms confirms that sleeps were disabled
358-
timeout: 100,
359-
interval: 100,
347+
// running under a second confirms that sleeps were disabled
348+
timeout: 1000,
349+
interval: 1000,
360350
}
361351
);
362352
});
@@ -461,10 +451,8 @@ describe("Long Workflow BATCH creation unit tests", () => {
461451
).every((s) => s.status === "errored");
462452
},
463453
{
464-
// config has 5 retires, all 50ms appart
465-
// should run in a bit over 250ms
466-
timeout: 350,
467-
interval: 350,
454+
timeout: 1000,
455+
interval: 1000,
468456
}
469457
);
470458
});
@@ -505,10 +493,8 @@ describe("Long Workflow BATCH creation unit tests", () => {
505493
).every((s) => s.status === "complete");
506494
},
507495
{
508-
// config has 5 retires, all 50ms appart
509-
// with 2 retires, should run in a bit over 100ms
510-
timeout: 150,
511-
interval: 150,
496+
timeout: 1000,
497+
interval: 1000,
512498
}
513499
);
514500
});
@@ -547,10 +533,8 @@ describe("Long Workflow BATCH creation unit tests", () => {
547533
).every((s) => s.status === "errored");
548534
},
549535
{
550-
// config has 5 retires, all 50ms appart
551-
// should run in a bit over 250m
552-
timeout: 350,
553-
interval: 350,
536+
timeout: 1000,
537+
interval: 1000,
554538
}
555539
);
556540
});
@@ -591,10 +575,8 @@ describe("Long Workflow BATCH creation unit tests", () => {
591575
).every((s) => s.status === "complete");
592576
},
593577
{
594-
// config has 5 retires, all 50ms appart
595-
// should run in a bit over 50ms
596-
timeout: 100,
597-
interval: 100,
578+
timeout: 1000,
579+
interval: 1000,
598580
}
599581
);
600582
});
@@ -636,10 +618,8 @@ describe("Long Workflow BATCH creation unit tests", () => {
636618
).every((s) => s.status === "complete");
637619
},
638620
{
639-
// config has 5 retires, all 50ms appart
640-
// should run in a bit over 100ms
641-
timeout: 150,
642-
interval: 150,
621+
timeout: 1000,
622+
interval: 1000,
643623
}
644624
);
645625
});
@@ -676,9 +656,9 @@ describe("Long Workflow BATCH creation unit tests", () => {
676656
).every((s) => s.status === "complete");
677657
},
678658
{
679-
// running under 50ms confirms that the event was moked (and sleeps were disabled)
680-
timeout: 50,
681-
interval: 50,
659+
// running under a second confirms that the event was moked (and sleeps were disabled)
660+
timeout: 1000,
661+
interval: 1000,
682662
}
683663
);
684664
});
@@ -715,9 +695,9 @@ describe("Long Workflow BATCH creation unit tests", () => {
715695
).every((s) => s.status === "errored");
716696
},
717697
{
718-
// running under 50ms confirms that the event was forced to time out (and sleeps were disabled)
719-
timeout: 50,
720-
interval: 50,
698+
// running under a second confirms that the event was forced to time out (and sleeps were disabled)
699+
timeout: 1000,
700+
interval: 1000,
721701
}
722702
);
723703
});

0 commit comments

Comments
 (0)