GeezerVison is showing github.com — test: deflake `test-loaders-workers-spawned` · nodejs/node@317e447
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: test/es-module/test-loaders-workers-spawned.mjs +7-1Lines changed: 7 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -48,8 +48,14 @@ describe('Worker threads do not spawn infinitely', { concurrency: true }, () => |
48 | 48 | ]); |
49 | 49 |
|
50 | 50 | assert.strictEqual(stderr, ''); |
| 51 | + // We are validating that: |
| 52 | + // 1. the `--require` flag is run first from the main thread (and A is printed). |
| 53 | + // 2. the `--require` flag is then run on the loader thread (and A is printed). |
| 54 | + // 3. the `--loader` module is executed (and B is printed). |
| 55 | + // 4. the `--import` module is evaluated once, on the main thread (and C is printed). |
| 56 | + // 5. the user code is finally executed (and D is printed). |
51 | 57 | // The worker code should always run before the --import, but the console.log might arrive late. |
52 | | - assert.match(stdout, /^A\r?\nA\r?\n(B\r?\nC|C\r?\nB)\r?\nD\r?\n$/); |
| 58 | + assert.match(stdout, /^A\r?\n(A\r?\nB\r?\nC|A\r?\nC\r?\nB|C\r?\nA\r?\nB)\r?\nD\r?\n$/); |
53 | 59 | assert.strictEqual(code, 0); |
54 | 60 | assert.strictEqual(signal, null); |
55 | 61 | }); |
|