Skip to content

@MainActor annotation on @Test method crashes the test plugin #501

@filip-sakel

Description

@filip-sakel

Here's a reproducer. I'm using the 6.2.3 Release Wasm SDK (non-embedded) with Swift 6.2.3 Release on aarch64-unknown-linux-gnu with swift tools version 6.0 (as shown in the linked repo). I'm getting the following error:

◇ Test run started.
↳ Testing Library Version: 6.2.3 (48a471ab313e858)
↳ Target Platform: wasm32-unknown-wasip
◇ Test myTest() started.
=================================================================================================
Detected that the test execution ended without a termination signal from the testing framework.
Hint: This typically means that a continuation leak occurred.
=================================================================================================
error: Error: Test failed with status 1

Observations

  1. I get the same error whether the @MainActor-isolated function synchronous is asynchronous.
  2. Removing the @MainActor attribute from the function signature and wrapping the function body in await MainActor.run { ... } produces the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions