Release response streams used by cache metadata probes
This commit is contained in:
@@ -89,3 +89,10 @@ test('blocking commit never waits on an optional file readiness probe',{timeout:
|
||||
await core.commit(m,c);assert.equal(extraProbes,0);assert.equal((await core.state(c)).current.buildTag,m.buildTag);
|
||||
c.match=match;assert.equal((await core.status(m,c)).offlineReady,false);
|
||||
});
|
||||
|
||||
test('metadata probes release response streams while stored asset bodies remain readable',async()=>{
|
||||
const c=cache(),m=manifest();await c.put('/a.js?v=a',response('a'));await c.put('/index.html?v=b',response('b'));
|
||||
const match=c.match,probes=[];c.match=async key=>{const r=await match(key);if(r)probes.push(r);return r;};
|
||||
assert.equal((await core.status(m,c)).offlineReady,true);assert.ok(probes.length>0);assert.ok(probes.every(r=>r.bodyUsed));
|
||||
assert.equal(await(await match('/a.js?v=a')).text(),'a');assert.equal(await(await match('/index.html?v=b')).text(),'b');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user