From 7829043a00cbbe4e281f9eedf362dbeb05f33816 Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 4 Sep 2026 19:54:07 +0200 Subject: [PATCH] test(app-config): pin the overpass budget against its own constant The client-side budget moved to twenty-five seconds when the query timeout it has to outlast was written down as a constant, and this assertion stayed on the old twelve. Pointing it at OVERPASS_TIMEOUT_DEFAULT_MS is what the test was after in the first place: the budget must be longer than the timeout the query carries, and a literal here is exactly how the two came apart. --- server/tests/unit/app-config/derive.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/tests/unit/app-config/derive.test.ts b/server/tests/unit/app-config/derive.test.ts index 300bc3f33..69ed62c01 100644 --- a/server/tests/unit/app-config/derive.test.ts +++ b/server/tests/unit/app-config/derive.test.ts @@ -1,5 +1,7 @@ import { describe, it, expect } from 'vitest'; +import { OVERPASS_TIMEOUT_DEFAULT_MS } from '../../../src/nest/maps/maps.helpers'; + import { deriveApp, deriveHttp, @@ -215,8 +217,10 @@ describe('deriveIntegrations', () => { expect(deriveIntegrations({ UNSPLASH_ACCESS_KEY: ' key ' }).unsplashAccessKey).toBe('key'); expect(deriveIntegrations({}).transitApiBase).toBe('https://api.transitous.org'); expect(deriveIntegrations({ TRANSIT_API_URL: 'https://t.example//' }).transitApiBase).toBe('https://t.example'); - expect(deriveIntegrations({}).overpassTimeoutMs).toBe(12000); - expect(deriveIntegrations({ OVERPASS_TIMEOUT_MS: '-1' }).overpassTimeoutMs).toBe(12000); + // Against the constant, not a literal: the client budget is derived from the timeout + // the query itself carries, and pinning the number here is how the two drifted apart. + expect(deriveIntegrations({}).overpassTimeoutMs).toBe(OVERPASS_TIMEOUT_DEFAULT_MS); + expect(deriveIntegrations({ OVERPASS_TIMEOUT_MS: '-1' }).overpassTimeoutMs).toBe(OVERPASS_TIMEOUT_DEFAULT_MS); }); it('floors the LLM ceiling to a whole number — undici rejects a fractional headersTimeout', () => {