@open-mercato/events 0.5.1-develop.2652.0276e72e45 → 0.5.1-develop.2657.a01847a9fa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/events",
|
|
3
|
-
"version": "0.5.1-develop.
|
|
3
|
+
"version": "0.5.1-develop.2657.a01847a9fa",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@open-mercato/queue": "0.5.1-develop.
|
|
36
|
-
"@open-mercato/shared": "0.5.1-develop.
|
|
35
|
+
"@open-mercato/queue": "0.5.1-develop.2657.a01847a9fa",
|
|
36
|
+
"@open-mercato/shared": "0.5.1-develop.2657.a01847a9fa",
|
|
37
37
|
"pg": "8.20.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -374,15 +374,19 @@ describe('Events Worker', () => {
|
|
|
374
374
|
const job = createMockJob('test.parallel', {})
|
|
375
375
|
const ctx = createMockContext()
|
|
376
376
|
|
|
377
|
-
const startTime = Date.now()
|
|
378
377
|
await handle(job, ctx)
|
|
379
|
-
const totalTime = Date.now() - startTime
|
|
380
378
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
379
|
+
const starts = executionLog.filter((e) => e.phase === 'start')
|
|
380
|
+
const ends = executionLog.filter((e) => e.phase === 'end')
|
|
381
|
+
expect(starts).toHaveLength(3)
|
|
382
|
+
expect(ends).toHaveLength(3)
|
|
383
|
+
|
|
384
|
+
const lastStart = Math.max(...starts.map((e) => e.time))
|
|
385
|
+
const firstEnd = Math.min(...ends.map((e) => e.time))
|
|
386
|
+
// Parallel dispatch: every subscriber must have started before any finished.
|
|
387
|
+
// Sequential would produce firstEnd < lastStart. This structural check is
|
|
388
|
+
// robust to CI timing jitter, unlike a wall-clock total-duration assertion.
|
|
389
|
+
expect(lastStart).toBeLessThanOrEqual(firstEnd)
|
|
386
390
|
})
|
|
387
391
|
|
|
388
392
|
it('should throw when all subscribers fail', async () => {
|