Closed remorses closed 4 months ago
Attention: 11 lines
in your changes are missing coverage. Please review.
Comparison is base (
adcf936
) 96.02% compared to head (fabf95c
) 95.98%.
Files | Patch % | Lines |
---|---|---|
lib/sinon/proxy.js | 37.50% | 10 Missing :warning: |
lib/sinon/proxy-invoke.js | 80.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This currently fails on your branch:
cat > test/concurrency-test.js << EOF
const assert = require("node:assert");
const sinon = require("../lib/sinon");
const sbA = sinon.createSandbox();
const sbB = sinon.createSandbox();
const F = sbA.fake();
const f1 = sbB.fake();
const f2 = sbB.fake();
f1();
F();
f2();
assert(f1.calledImmediatelyBefore(f2));
EOF
node test/concurrency-test.js
@remorses Do you need some guidance in how to progress? AFAIK the old-skool API is covered (haven't checked the mocks API, but I think that should be covered by the proxy stuff).
Ping?
This does not seem like it is going places. Closing due to unresponsiveness.
Make sandbox concurrency safe
Fix #2472, sandbox not working when running tests concurrently because of global callId variable
Solution
Store callId in a context passed with an optional argument, which is the sandbox object when using sandbox
How to verify - mandatory
Added a test with the #2472 reproduction
npm install
Checklist for author
npm run lint
passes