CtrlK
BlogDocsLog inGet started
Tessl Logo

testland/async-ordering-tests

Test async ordering - event-loop / queue / channel ordering assertions, JS Promise microtask vs macrotask ordering, Python `asyncio.gather` vs `asyncio.wait_for` semantics, Go goroutine + channel happens-before relationships, async/await re-entrancy. Use deterministic schedulers (sinon fake timers, asyncio test mode) to remove run-to-run variance. Use when a callback fires twice, a later response overwrites an earlier one, or a cancelled parent task leaves a child still running - bugs where completion order, not shared memory, is the defect.

87

1.00x
Quality

86%

Does it follow best practices?

Impact

94%

1.00x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

Evaluation results

100%

Cancelling an upload leaves chunks in flight

Criteria
Baseline
With context

Test file created

100%

100%

Abort arrives while a chunk is genuinely in flight

100%

100%

The signal reaches the child

100%

100%

No further chunk is started after the cancel

100%

100%

Caller observes an abort, not a normal result

100%

100%

Cleanup runs on the cancelled path

100%

100%

No timed sleep used to sequence the abort

100%

100%

Fresh controller and recorders per test

100%

100%

89%

Search results flicker back to the previous query

Criteria
Baseline
With context

Test file created

100%

100%

Completion order controlled explicitly

100%

100%

Superseded response does not overwrite current results

100%

100%

Superseded call reports why it did not apply

100%

100%

In-order case still applies

0%

0%

Both requests are in flight simultaneously

100%

100%

No real-time delay anywhere in the test

100%

100%

Fresh controller per test

100%

100%

94%

Subscribers must see a change before it is persisted

Criteria
Baseline
With context

Test file created

100%

100%

Ordering observed at an intermediate point

100%

100%

Microtask checkpoint is a microtask

100%

100%

Persistence asserted after a macrotask boundary

100%

100%

Coalescing asserted by count

100%

100%

No timed sleep used as a wait

100%

100%

Unsubscribe covered

0%

0%

Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents