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

criteria.jsonevals/scenario-1/

{
  "context": "Cancellation that arrives while a child operation is in flight, where abort-before-start is already covered. Predicted baseline failure: the agent writes another abort-before-start variant, or aborts after awaiting the whole upload - both of which avoid the mid-flight window entirely. When it does aim at mid-flight, it usually schedules the abort with a short real-time delay and hopes the timing lands inside the first chunk. The skill's value is holding the child open under the test's control so the cancel is guaranteed to arrive mid-flight, and asserting propagation to the child rather than only the caller's rejection.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Test file created",
      "description": "A file src/upload.test.js exists and contains at least one test.",
      "max_score": 4
    },
    {
      "name": "Abort arrives while a chunk is genuinely in flight",
      "description": "A test holds a chunk upload unresolved - a deferred promise the test settles - calls abort() while it is pending, then releases it. Aborting before the call, or after awaiting the whole upload, scores zero on this criterion: neither reaches the window the ticket describes. Timing the abort with a real-time delay also scores zero, since the window is then not guaranteed.",
      "max_score": 30
    },
    {
      "name": "The signal reaches the child",
      "description": "The test captures the second argument passed to uploadChunk and asserts it is the same signal the caller supplied, and that it reports aborted once abort() is called. Asserting only that the outer promise rejected leaves the propagation claim untested, and scores zero here.",
      "max_score": 20
    },
    {
      "name": "No further chunk is started after the cancel",
      "description": "The test records which chunks were started and asserts the loop stopped - the chunk after the in-flight one was never begun. This is the bandwidth symptom in the ticket; a suite without it scores zero on this criterion.",
      "max_score": 20
    },
    {
      "name": "Caller observes an abort, not a normal result",
      "description": "The returned promise is asserted to reject with an error whose name is AbortError, using a rejection assertion rather than a try/catch that could pass silently if no error were thrown.",
      "max_score": 12
    },
    {
      "name": "Cleanup runs on the cancelled path",
      "description": "A test supplies onCleanup and asserts it was invoked with aborted true and the count of chunks that completed before the cancel.",
      "max_score": 10
    },
    {
      "name": "No timed sleep used to sequence the abort",
      "description": "MUST NOT. The file contains no setTimeout or delay promise with a nonzero duration used to place the abort inside the in-flight window. Any such call scores zero on this criterion.",
      "max_score": 10
    },
    {
      "name": "Fresh controller and recorders per test",
      "description": "MUST NOT share an AbortController or a started-chunks array across tests at module scope; an already-aborted controller would decide later cases.",
      "max_score": 4
    }
  ]
}

SKILL.md

tile.json