Skip to content

Fix two tests that only pass under Apple's XCTest - #71

Closed
lhoward wants to merge 1 commit into
sideeffect-io:mainfrom
lhoward:upstream/test-fixes
Closed

lhoward wants to merge 1 commit into
sideeffect-io:mainfrom
lhoward:upstream/test-fixes

Conversation

@lhoward

@lhoward lhoward commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Description

Two test-only changes, no library code touched:

  • Tests/AsyncSubjets/StreamedTests.swift imports Combine but uses nothing from it; the import stops the test target compiling wherever Combine is absent. Removed.
  • AsyncLazySequenceTests.test_AsyncLazySequence_returns_an_asyncSequence_that_finishes_when_task_is_cancelled is a synchronous test that returns while the Task it started is still await fulfillment(of:)-ing an expectation. Apple's XCTest tolerates that; corelibs-XCTest reports Failed due to unwaited expectation 'The task has been cancelled'. The test is now async, uses await fulfillment(of:) for the first expectation and awaits the task before returning, so the assertion inside the task also runs before the test ends.

Tests

Linux, Swift 6.4, x86_64, with #70 applied underneath (the library needs it to compile here), three consecutive runs:

Executed 199 tests, with 0 failures (0 unexpected) in 15.61 (15.61) seconds
Executed 199 tests, with 0 failures (0 unexpected) in 15.478 (15.478) seconds
Executed 199 tests, with 0 failures (0 unexpected) in 15.672 (15.672) seconds

Checklist

  • this PR is based on the main branch and is up-to-date
  • the commits inside this PR have explicit commit messages
  • unit tests cover the new feature or the bug fix (test-only change)
  • the CHANGELOG is up-to-date (no user-visible change)

🤖 Generated with Claude Code

https://claude.ai/code/session_01T8cahEd4GfsHQ89sNrmP4p

StreamedTests imports Combine without using it, which stops the test
target compiling where Combine is absent. The AsyncLazySequence
cancellation test returned while its Task was still awaiting an
expectation; corelibs-XCTest reports that as an unwaited expectation, so
the test is now async and awaits the task.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T8cahEd4GfsHQ89sNrmP4p
@twittemb

twittemb commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by merged PR #74: #74.

Both fixes are now on main: the unused Combine import has been removed, and the lazy-sequence cancellation test is asynchronous, awaits the first expectation, and awaits the child task before returning. The full 200-test suite passes in Linux CI on Swift 6.1.3 and 6.4.0, so this PR no longer needs to be merged.

@twittemb twittemb closed this Oct 4, 2026
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