Slow-booting routers and the Junipurr PacketOinker
This commit is contained in:
parent
c3322cc47b
commit
8649495b50
3 changed files with 44 additions and 11 deletions
|
|
@ -65,3 +65,23 @@ test('#6 full transit, IX, caches and routers show up in the NOC and on the map'
|
|||
ev("draw&&draw(performance.now())");
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('some routers take forever to boot, PacketOinkers most of all', () => {
|
||||
const { ev, errors } = load();
|
||||
base(ev);
|
||||
const pct = JSON.parse(ev("JSON.stringify(RG.map((G,g)=>{let n=0;for(const c of ALLC){S.pops[c]=S.pops[c]||{rgen:g,routers:1};S.pops[c].rgen=g;if(slowBoot(c))n++;}return n/ALLC.length;}))"));
|
||||
assert.ok(pct[0] < pct[2] && pct[2] > 0.2 && pct[0] < 0.3, `bigger chassis are slow more often (${pct})`);
|
||||
assert.match(ev("RG[2].chip"), /PacketOinker/);
|
||||
// find a slow and a fast POP and crash them
|
||||
ev("for(const c of ALLC)if(c!=='fra')delete S.pops[c];S.pops.fra.rgen=2;S.pops.fra.routers=1");
|
||||
const slowCity = ev("ALLC.find(c=>{S.pops[c]={rgen:2,routers:1,down:0};const s=slowBoot(c);if(!s)delete S.pops[c];return s;})");
|
||||
ev(`for(const c of Object.keys(S.pops))if(c!=='${slowCity}')delete S.pops[c];S.transit=[];S.ixp={};for(let i=0;i<800&&!S.inc.some(x=>x.type==='crash');i++){fireFailure();S.inc=S.inc.filter(x=>x.type==='crash');}`);
|
||||
const inc = JSON.parse(ev("JSON.stringify(S.inc.find(i=>i.type==='crash'))"));
|
||||
assert.ok(inc.slow, 'crash on a slow booter is flagged');
|
||||
assert.ok(inc.until - ev('S.day') >= 4, 'and lasts longer');
|
||||
ev(`S.cash=1e6;ACT.fixInc({id:'${inc.id}'})`);
|
||||
assert.equal(ev(`S.inc.find(i=>i.id==='${inc.id}').until`), ev('S.day+1'), 'rushing it still takes a day');
|
||||
ev(`selectCity('${slowCity}');ACT.tab({t:'infra'})`);
|
||||
assert.match(ev("document.getElementById('panelBody').textContent"), /a slow one/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue