comq 0.5.2 → 0.5.3-dev.0
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.
|
@@ -172,11 +172,13 @@ describe('Given I\'m publishing {quantity}B events to the {token} exchange at {q
|
|
|
172
172
|
|
|
173
173
|
step.call(context, bytesQ, exchange, frequencyQ)
|
|
174
174
|
|
|
175
|
-
await timeout(100 +
|
|
175
|
+
await timeout(100 + 12)
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
const callsAmountExpected = [10, 11]
|
|
178
|
+
|
|
179
|
+
expect(callsAmountExpected).toContain(context.io.emit.mock.calls.length)
|
|
178
180
|
expect(context.publishing).toBeDefined()
|
|
179
|
-
expect(context.eventsPublishedCount)
|
|
181
|
+
expect(callsAmountExpected).toContain(context.eventsPublishedCount)
|
|
180
182
|
|
|
181
183
|
clearInterval(context.publishing)
|
|
182
184
|
})
|
|
@@ -219,11 +219,13 @@ describe('Given I\'m sending {quantity}B requests to the {token} queue at {quant
|
|
|
219
219
|
|
|
220
220
|
step.call(context, bytesQ, queue, frequencyQ)
|
|
221
221
|
|
|
222
|
-
await timeout(100 +
|
|
222
|
+
await timeout(100 + 12)
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
const callsAmountExpected = [10, 11]
|
|
225
|
+
|
|
226
|
+
expect(callsAmountExpected).toContain(context.io.request.mock.calls.length)
|
|
225
227
|
expect(context.sending).toBeDefined()
|
|
226
|
-
expect(context.requestsSent.length)
|
|
228
|
+
expect(callsAmountExpected).toContain(context.requestsSent.length)
|
|
227
229
|
|
|
228
230
|
clearInterval(context.sending)
|
|
229
231
|
})
|
package/features/steps/broker.js
CHANGED
|
@@ -46,10 +46,11 @@ async function healthy () {
|
|
|
46
46
|
let process
|
|
47
47
|
|
|
48
48
|
do {
|
|
49
|
-
await timeout(
|
|
49
|
+
await timeout(HEALTHCHECK_INTERVAL)
|
|
50
50
|
|
|
51
51
|
process = await execute('docker inspect -f {{.State.Health.Status}} comq-rmq-0')
|
|
52
52
|
} while (process.output !== 'healthy')
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const BROKERS_AMOUNT = 2
|
|
56
|
+
const HEALTHCHECK_INTERVAL = global.COMQ_TESTING_HEALTHCHECK_INTERVAL ?? 1000
|
package/lerna.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comq",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3-dev.0",
|
|
4
4
|
"description": "ComQ",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Artem Gurtovoi",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"main": "source/index.js",
|
|
28
28
|
"types": "types/index.d.ts",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@cucumber/cucumber": "9.0
|
|
30
|
+
"@cucumber/cucumber": "9.1.0",
|
|
31
31
|
"@toa.io/command": "0.3.0",
|
|
32
32
|
"@toa.io/mock": "0.3.0",
|
|
33
33
|
"@toa.io/tomato": "0.4.0-dev.2",
|
package/test/channel.test.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
const { randomBytes } = require('node:crypto')
|
|
6
6
|
const { generate } = require('randomstring')
|
|
7
|
-
const { flip, random } = require('@toa.io/generic')
|
|
7
|
+
const { flip, random, timeout } = require('@toa.io/generic')
|
|
8
8
|
|
|
9
9
|
const backpressure = require('./backpressure')
|
|
10
10
|
const { amqplib } = require('./amqplib.mock')
|
|
@@ -730,7 +730,7 @@ describe('recovery', () => {
|
|
|
730
730
|
|
|
731
731
|
const chan = await getCreatedChannel()
|
|
732
732
|
|
|
733
|
-
chan.publish.mockImplementation(() => true)
|
|
733
|
+
chan.publish.mockImplementation(() => true) // back pressure
|
|
734
734
|
|
|
735
735
|
/** @type {jest.MockedObject<comq.amqp.Connection>} */
|
|
736
736
|
let replacement
|
|
@@ -747,6 +747,8 @@ describe('recovery', () => {
|
|
|
747
747
|
|
|
748
748
|
const repl = await getCreatedChannel(replacement)
|
|
749
749
|
|
|
750
|
+
await timeout(1)
|
|
751
|
+
|
|
750
752
|
expect(repl.publish).toHaveBeenCalledWith(
|
|
751
753
|
exchange, '', buffer, expect.objectContaining(options), expect.any(Function)
|
|
752
754
|
)
|