You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test assertion in attack-cpu-background randomly failed probably due to a buggy timer resolution:
describe('when the process takes some time to initialise',()=>{it('waits',async()=>{onFn.mockImplementationOnce((_msg,cb)=>setTimeout(cb,10));constattack=newBackgroundCPUAttack({threads: 1});consttime=Date.now();awaitattack.start();expect(Date.now()-time).toBeGreaterThanOrEqual(10);});});
It occurred once while I was developing locally and during the execution of GA. Sadly the job was rerun and the logs are lost.
I've executed the tests in a loop dozens of times and could not reproduce 🤔.
Expected behavior
I expect the tests to pass always if there is no bug in code.
Actual behavior
A single test that is dependant on time fails occasionally.
Code to reproduce
Hard to reproduce but just
npm t
Possible fix
Change test implementation to use mocked timers and avoid time dependency.
Description/Context
Test assertion in
attack-cpu-background
randomly failed probably due to a buggy timer resolution:It occurred once while I was developing locally and during the execution of GA. Sadly the job was rerun and the logs are lost.
I've executed the tests in a loop dozens of times and could not reproduce 🤔.
Expected behavior
I expect the tests to pass always if there is no bug in code.
Actual behavior
A single test that is dependant on time fails occasionally.
Code to reproduce
Hard to reproduce but just
Possible fix
Change test implementation to use mocked timers and avoid time dependency.
Checklist
The text was updated successfully, but these errors were encountered: