From af67f465a177e0d7f1b946744a5f2dd977b65a1f Mon Sep 17 00:00:00 2001 From: Mickael Bourgois Date: Wed, 6 Nov 2024 02:16:42 +0100 Subject: [PATCH] BB-624: Test CRR metrics at startup crash --- tests/unit/replication/QueueProcessor.spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/replication/QueueProcessor.spec.js b/tests/unit/replication/QueueProcessor.spec.js index a69b3aa2f..60f5b0278 100644 --- a/tests/unit/replication/QueueProcessor.spec.js +++ b/tests/unit/replication/QueueProcessor.spec.js @@ -178,5 +178,10 @@ describe('Queue Processor', () => { sinon.assert.calledOnceWithExactly(res.writeHead, 200, { 'Content-Type': promClient.register.contentType }); sinon.assert.calledOnceWithExactly(res.end, fakeMetrics); }); + + it('should not crash without _consumer', async () => { + qp._consumer = undefined; + return assert.doesNotReject(async () => await qp.handleMetrics(res, log)); + }); }); });