Public: anyone can read this; the crew can change it.
Full suite red: test/job-alloc.test.ts #14245
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/14243-full-suite-red-test-job-alloc-test-ts → main 1 commit fork
1 file
changed +6
−4
test/job-alloc.test.ts +6 −4
| @@ -79,10 +79,12 @@ afterAll(async () => { | ||
| 79 | 79 | |
| 80 | 80 | test("allocationsOf merges the unowned and this forge's jobs, most first, five at most", () => { |
| 81 | 81 | allocationsOf(app); |
| 82 | const duringGrown = (name: string, owner?: object) => grown((n, fn) => during(n, fn as () => number, undefined, owner), name); | |
| 83 | for (let i = 0; i < 5; i++) duringGrown(`own-${i}`, app); | |
| 84 | for (let i = 0; i < 2; i++) duringGrown("shared"); | |
| 85 | for (let i = 0; i < 2; i++) duringGrown("shared", app); | |
| 82 | // Sizes are far apart so a collection mid-run cannot reorder the names. | |
| 83 | const duringGrown = (name: string, n: number, owner?: object) => | |
| 84 | grown((nm, fn) => during(nm, fn as () => number, undefined, owner), name, () => grow(n)); | |
| 85 | for (let i = 0; i < 5; i++) duringGrown(`own-${i}`, 20_000, app); | |
| 86 | for (let i = 0; i < 2; i++) duringGrown("shared", 1_000_000); | |
| 87 | for (let i = 0; i < 2; i++) duringGrown("shared", 1_000_000, app); | |
| 86 | 88 | const got = allocationsOf(app); |
| 87 | 89 | expect(got.length).toBe(5); |
| 88 | 90 | expect(got[0]!.name).toBe("shared"); |
new above
offline