From d8223bad0401f5bfe43ba5536eb2146667ef9391 Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Tue, 10 Nov 2026 07:14:36 +0000 Subject: [PATCH] Tests: route fuzz compares the customer catalog, day steps waits longer for its trial A new customer type changes which offers a seeded late-game draws, so the fuzz games cannot play move for move like main (as with a world change), and the sales-trial race in day-steps comes on day 46 instead of before day 20. --- tests/day-steps.test.js | 3 ++- tests/route-fuzz.test.js | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/day-steps.test.js b/tests/day-steps.test.js index 027b065..866cc51 100644 --- a/tests/day-steps.test.js +++ b/tests/day-steps.test.js @@ -189,7 +189,8 @@ test('a customer dropped while a sales trial routes: the trial runs again on the p.ev(TICK_ERR); p.ev("window.__ot=0;const ot=offerTrial;offerTrial=(...a)=>{__ot++;return ot(...a);};"); let found = false; - for (let d = 0; d < 20 && !found; d++) { + // Which day such a trial comes depends on the offers the seeded game draws (day 46 since latency contracts joined them). + for (let d = 0; d < 60 && !found; d++) { p.ev('rwDay()'); for (let k = 0; k < 400 && p.ev('!!RW.job'); k++) { if (p.ev('__later.length')) { p.ev('__later.shift()()'); continue; } diff --git a/tests/route-fuzz.test.js b/tests/route-fuzz.test.js index 8207da4..c0787f2 100644 --- a/tests/route-fuzz.test.js +++ b/tests/route-fuzz.test.js @@ -17,10 +17,10 @@ function pages() { let base = head; try { const b = path.join(os.tmpdir(), `tubes-fuzz-test-${process.pid}-base.html`); fs.writeFileSync(b, page.assembleRef('origin/main')); base = b; } catch (e) {} let P = { base: openPage(base, 'base'), head: openPage(head, 'head') }; - // A change to the world itself (cities, networks, cables) or to what links cost cannot route like main: there is no - // same game to compare. Then the base is this checkout too, and the cache on/off check still runs; equivalence with - // main resumes once it lands. - const world = (p) => p.ev("JSON.stringify([CITIES.map(c=>[c.id,c.land,c.P]),NETS.map(n=>[n.id,n.pops,n.ix,n.share,n.price,n.up]),CABLES.map(c=>[c.id,c.pairs.map(q=>[q[0],q[1]])]),[1,300,3000].map(k=>[dfLeaseMo(k),waveMo(k,false,2),dfBuildCost(k)])])"); + // A change to the world itself (cities, networks, cables, the kinds of customers that call) or to what links cost + // cannot route like main: there is no same game to compare. Then the base is this checkout too, and the cache on/off + // check still runs; equivalence with main resumes once it lands. + const world = (p) => p.ev("JSON.stringify([CITIES.map(c=>[c.id,c.land,c.P]),NETS.map(n=>[n.id,n.pops,n.ix,n.share,n.price,n.up]),CABLES.map(c=>[c.id,c.pairs.map(q=>[q[0],q[1]])]),[1,300,3000].map(k=>[dfLeaseMo(k),waveMo(k,false,2),dfBuildCost(k)]),Object.keys(BIZ_T).map(t=>[t,BIZ_T[t].lv||1,BIZ_T[t].opts])])"); if (base !== head && world(P.base) !== world(P.head)) { console.log('# route fuzz: the world or its prices differ from main, so both pages are this checkout'); P = { base: openPage(head, 'base'), head: P.head }; } return P; }