From 18ca49c44aa2aad1aef5a8b344137494298cfee1 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Tue, 1 Sep 2026 04:29:19 +0700 Subject: [PATCH] test(dashmate): use a sentinel wake-up counter the clock cannot collide with MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The counter-leak guard asserted the rendered text never contains "37", but the fixture builds times from the live clock and the solution renders minute fields — any :37 minute made the assertion fail. A 6-digit sentinel keeps the guard while being impossible in any date or time slice. Co-Authored-By: Claude Fable 5 --- .../analyse/analyseGatewayCertificateFactory.spec.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/dashmate/test/unit/doctor/analyse/analyseGatewayCertificateFactory.spec.js b/packages/dashmate/test/unit/doctor/analyse/analyseGatewayCertificateFactory.spec.js index 962e1424a68..017c12a4d60 100644 --- a/packages/dashmate/test/unit/doctor/analyse/analyseGatewayCertificateFactory.spec.js +++ b/packages/dashmate/test/unit/doctor/analyse/analyseGatewayCertificateFactory.spec.js @@ -754,7 +754,10 @@ describe('analyseGatewayCertificateFactory', () => { detail: 'acme: error: 400 :: urn:ietf:params:acme:error:connection :: timeout', attemptedAt: new Date(Date.now() - 30 * 60 * 1000).toISOString(), lastSuccessAt: new Date(Date.now() - 5 * DAY_MS).toISOString(), - consecutiveFailures: 37, + // A sentinel no rendered date or time can contain: the counter-leak + // assertions below match it verbatim, so a coincidental "37" in a + // minute field can no longer fail them. + consecutiveFailures: 739577, issuanceSpentAt: null, issuanceUncertainAt: null, gatewayReloadFailedAt: null, @@ -912,8 +915,8 @@ describe('analyseGatewayCertificateFactory', () => { expect(renewal.getDescription()).to.not.contain('failing since'); expect(renewal.getSolution()).to.not.contain('failing since'); // The counter counts scheduler wake-ups, not attempts. - expect(renewal.getDescription()).to.not.contain('37'); - expect(renewal.getSolution()).to.not.contain('37'); + expect(renewal.getDescription()).to.not.contain('739577'); + expect(renewal.getSolution()).to.not.contain('739577'); }); it('should name the cause instead of sending an operator to the logs', () => {