Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when running an arguments test when parallel tests are enabled #565

Closed
noremac opened this issue Jul 22, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@noremac
Copy link

noremac commented Jul 22, 2024

Description

I have written a stripped down reproduction case that more reliably-than-not produces a crash when run.

Expected behavior

I would expect this test to run successfully without crashing.

Actual behavior

The test (usually) crashes with the following error:

XCTest/HarnessEventHandler.swift:303: Fatal error: Internal inconsistency: No test reporter for test case argumentIDs: nil in test MyLibraryTests.FooTests/equal(lhs:rhs:)/MyLibraryTests.swift:17:4

Steps to reproduce

  1. Make a new swift package and use swift testing as the testing system.
  2. Paste the following in to a test.
  3. Ensure parallel tests are enabled.
  4. Run the suite.

For me it crashes more often than not.

import Testing

struct Foo: Equatable, ExpressibleByIntegerLiteral, ExpressibleByStringLiteral {
  let value: String

  init(stringLiteral value: String) {
    self.value = value
  }

  init(integerLiteral value: Int) {
    self.value = String(value)
  }
}

@Suite
struct FooTests {
  @Test(arguments: [
    ("1" as Foo, "1" as Foo),
    (1, 1),
    (2, 2),
    (3, 3),
  ])
  func equal(lhs: Foo, rhs: Foo) {
    #expect(lhs == rhs)
  }
}

swift-testing version/commit hash

Xcode 16.0 beta 3 (16A5202i)

Swift & OS version (output of swift --version ; uname -a)

swift-driver version: 1.111.2 Apple Swift version 6.0 (swiftlang-6.0.0.5.15 clang-1600.0.22.6)
Target: arm64-apple-macosx15.0
Darwin Studio.local 24.0.0 Darwin Kernel Version 24.0.0: Mon Jul 1 21:58:14 PDT 2024; root:xnu-11215.0.132.501.1~1/RELEASE_ARM64_T6000 arm64

@noremac noremac added the bug Something isn't working label Jul 22, 2024
@grynspan
Copy link
Contributor

Duplicate of #480

@grynspan grynspan marked this as a duplicate of #480 Jul 22, 2024
@grynspan grynspan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants