Skip to content

Deflake ActorQueue queue-deallocation tests by awaiting the enqueued task - #85

Merged
dfed merged 1 commit into
mainfrom
claude/ci-failures-main-pr-dpx2v8
Nov 2, 2026
Merged

dfed merged 1 commit into
mainfrom
claude/ci-failures-main-pr-dpx2v8

Conversation

@dfed

@dfed dfed commented Nov 2, 2026

Copy link
Copy Markdown
Owner

CI is red on main (weekly scheduled run) and on #84, in both cases only in Build Xcode 26 (iOS_18,watchOS_11):

✘ task_executesEnqueuedTasksAfterQueueIsDeallocated()        ActorQueueTests.swift:260
✘ throwingTask_executesEnqueuedTasksAfterQueueIsDeallocated() ActorQueueTests.swift:284
  ↳ Expectation not fulfilled within 30 seconds

Why it started

No code changed: 8087866 passed on 10/26 and failed on 11/02. The macOS runner image did change, from macos-15-arm64 20260907.0337.1 (macOS 15.7.9) to 20261028.0489.1 (macOS 15.8.2). On the new image the iOS simulator occasionally stalls the whole test process. Iterations usually take 1–2s, but one took 69.7s on main and another 57s on #84, and trivial tests in those iterations took 50s or more too. With -test-iterations 100, one stall is enough to fail the job.

These two tests are the last library tests that rely on a 30-second wall-clock Expectation, so they're the only ones a stall can fail.

Fix

This applies the same change #78 made to the FIFOQueueTests equivalents. Each test keeps the Task returned by Task(on:) and awaits its value instead of the timer. Awaiting the value still proves that the enqueued work ran after the queue was deallocated, without depending on wall-clock time. The change touches tests only.


Generated by Claude Code

…task

task_executesEnqueuedTasksAfterQueueIsDeallocated and its throwing
variant were the last library tests gated on a 30-second wall-clock
Expectation. Since the macos-15-arm64 runner image moved to
20261028.0489 (macOS 15.8.2), the iOS simulator job intermittently stalls
for 40+ seconds during one of the 100 test iterations, so the timer
fires before the enqueued work is scheduled and the job fails.

Apply the same fix #78 made to the FIFOQueue equivalents: await the
enqueued task's value, which deterministically proves the work ran
after the queue deallocated without depending on wall-clock time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HLuVQJeXTSoTddfZif3cZK
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8087866) to head (389685e).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #85   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines         1313      1311    -2     
=========================================
- Hits          1313      1311    -2     
Files with missing lines Coverage Δ
Tests/AsyncQueueTests/ActorQueueTests.swift 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dfed
dfed enabled auto-merge (squash) November 2, 2026 05:27
@dfed
dfed disabled auto-merge November 2, 2026 05:28
@dfed
dfed merged commit 46fdbd5 into main Nov 2, 2026
12 checks passed
@dfed
dfed deleted the claude/ci-failures-main-pr-dpx2v8 branch November 2, 2026 05:28
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.

2 participants