Audit native transports and retain secure export diagnostics
This commit is contained in:
1 parent
8a253eda89
commit
0a5df7398e
28 files changed
+636
-53
No files matched your search
@@ -69,5 +69,13 @@ test('concurrent proposal requests are bounded and policy changes during provide
|
||||
const f=await fixture(t);let release;f.setGate(new Promise(r=>{release=r;}));const pending=f.propose();
|
||||
for(let n=0;n<100&&f.calls()===0;n++)await new Promise(r=>setTimeout(r,10));assert.equal(f.calls(),1);
|
||||
assert.equal((await f.propose()).status,409);assert.equal(f.calls(),1);
|
||||
const p=f.store.get('policy');p.version++;f.store.put('policy',p);release();assert.equal((await pending).status,409);assert.equal(f.store.personalBookmarks(f.device.id).revision,1);
|
||||
const p=f.store.get('policy');p.version++;f.store.put('policy',p);const rejected=await pending;release();assert.equal(rejected.status,409);assert.equal(f.store.personalBookmarks(f.device.id).revision,1);
|
||||
});
|
||||
|
||||
test('provider deadline returns fixed 504 before held provider output is released',async t=>{
|
||||
const f=await fixture(t);let release,deadline;f.setGate(new Promise(resolve=>{release=resolve;}));
|
||||
const timeout=globalThis.setTimeout;
|
||||
t.mock.method(globalThis,'setTimeout',(callback,milliseconds,...args)=>{if(milliseconds===60000){deadline=callback;return timeout(()=>{},60000);}return timeout(callback,milliseconds,...args);});
|
||||
const pending=f.propose();for(let n=0;n<100&&f.calls()===0;n++)await new Promise(resolve=>timeout(resolve,10));assert.equal(f.calls(),1);assert.equal(typeof deadline,'function');
|
||||
deadline();const result=await pending;release();assert.equal(result.status,504);assert.equal(result.body.error,'Request failed');assert.equal(f.store.personalBookmarks(f.device.id).revision,1);
|
||||
});
|
||||
Reference in new issue
Block a user