Skip to content

test: synchronize timed send-batch deadline assertions - #794

Merged
SunSi12138 merged 1 commit into
devfrom
fix/387-timed-batch-synchronization
Oct 9, 2026
Merged

SunSi12138 merged 1 commit into
devfrom
fix/387-timed-batch-synchronization

Conversation

@SunSi12138

@SunSi12138 SunSi12138 commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Context

Refs #387.

This addresses the TimedBatchShouldExtendBatchForFrameArrivingBeforeDeadline subcase only. The reported macOS failure reached the output read after both provider timer-arm observations, then expired its independent two-second wall-clock guard. That log does not establish the original scheduler interleaving or a production SendPump/WakeupSignal defect.

Changes

  • Replace this test's timer-arm polling with awaitable observations published after the underlying timer is armed.
  • Keep the original 100 ms provider deadline when frame 2 arrives at 50 ms; assert no early flush, exactly one timed flush, and exactly two ordered frames.
  • Exercise both ordinary and deliberately deferred PipeReader continuation scheduling.
  • Use the existing 30-second TUnit timeout and cancellation-aware semantic waits, with a post-read cleanup barrier, owner return, zero queued bytes and zero timers.
  • Allocate frame 2 only immediately before submission so cancellation before its send does not strand an owner.

Only the test and its private helpers change. No production change, timeout increase, retry or skip.

Validation

  • Full solution Release build: 0 warnings/errors.
  • 100 target repetitions: 200/200 cases passed.
  • 20 SendPump/WakeupSignal suite repetitions: 500/500 cases passed.
  • Generator tests: 269/269; LoadTest tests: 77/77.
  • Project-reference, maintainability and generated-assembly dependency guards passed.
  • Independent review: 60/60 additional target cases; missing-arm/missing-deadline controls failed at the unchanged timeout and completed resource cleanup; early/extended deadline and reordered-frame mutations were rejected.
  • A controlled delayed-reader experiment expired the former two-second guard while the provider clock remained at 100 ms and exactly one flush had occurred; releasing the continuation lets the candidate pass. This demonstrates the guard weakness, not the historical CI root cause.

Hosted validation for e5695f153d897e7173ad3635113c4d642f13ec94

  • PR Fast passed full formatting, Release build, guards, 1886/1886 unit tests, 269/269 generator tests, 77/77 LoadTest tests, and the allocation gate.
  • CodeQL passed.
  • Focused Linux/macOS evidence passed on Ubuntu x64 and macOS arm64. Each platform completed 100 target repetitions (200 cases) and 20 combined SendPump/WakeupSignal repetitions (500 cases), with zero failures or skips.
  • Both retained artifacts contain all 120 per-iteration logs plus an environment file with the exact candidate SHA. The separate validation-only workflow checks out that SHA explicitly; no helper workflow is included in this PR.
  • Final independent review verified the published one-file diff, exact-head evidence, artifact digests/counts, and absence of unresolved review threads.

Hosted CI resolves the local sandbox's full-unit and solution-format limitations. The controlled delayed-reader and cancellation-cleanup experiments remain test-harness evidence; they do not establish the original macOS failure's exact cause.

The umbrella issue stays open for its other subcases.

Replace this manually timed test's polling and independent read timeout with cancellation-aware semantic barriers. Cover deferred reader scheduling and assert the original deadline, exact ordered frames, one timed flush, and resource cleanup.

Refs #387
@SunSi12138
SunSi12138 marked this pull request as ready for review October 9, 2026 11:50

Copy link
Copy Markdown
Owner Author

Ready-for-review verification is complete for e5695f153d897e7173ad3635113c4d642f13ec94.

  • Latest PR Fast, allocation gate and CodeQL: passed.
  • Ready-triggered PR Extended: passed, including integration, NativeAOT, packages, demo/load and the six-platform desktop codec matrix. Browser/WASM jobs are intentionally outside this tier.
  • Pinned-candidate Linux/macOS repeat evidence: each OS passed 100 target repetitions and 20 SendPump/WakeupSignal suite repetitions. Both complete per-iteration artifact sets and exact candidate identities were independently verified.

The PR remains the reviewed one-file test change. This addresses the timed-batch test-observation weakness; the original macOS interleaving remains unproven. Refs #387; the umbrella issue remains open.

@SunSi12138
SunSi12138 merged commit 7280616 into dev Oct 9, 2026
29 checks passed
@SunSi12138
SunSi12138 deleted the fix/387-timed-batch-synchronization branch October 9, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant