Fatal error: Internal inconsistency: No test reporter for test case argumentIDs:

I've been randomly running into this error when I use Testing in Xcode. I've only encountered it in this current project, but I cannot fathom anything that is special or different about this project than usual. I'm pretty sure this falls more under bug report than asking for help.

Thread 7: Fatal error: Internal inconsistency: No test reporter for test case argumentIDs: nil in test BigRationalModuleTests.InternalTests/floorDivision(args:)/InternalTests.swift:6:3

It seems to rear its head when I use @Test(arguments: [...]), and stop when I remove the arguments. It also crashes more often on some tests than others. I can determine no pattern.

I've not been able to replicate in the command line, only in Xcode (Version 16.0 (16A242d)), but I also haven't found a way to run tests on repeat with swift test either.

Here's the test code, console output, and a backtrace:

test code:


struct InternalTests {
	@Test(arguments: [
		(1, 2, 0),
		(2, 2, 1),
		(2, 1, 2),
		(-1, 2, -1),
		(-2, 2, -1),
		(-2, 1, -2),
		(1, -2, -1),
		(2, -2, -1),
		(2, -1, -2),
		(-1, -2, 0),
		(-2, -2, 1),
		(-2, -1, 2),
		(0, 1, 0),
		(0, -1, 0),
		(3, 4, 0),
		(4, 4, 1),
		(4, 3, 1),
		(-3, 4, -1),
		(-4, 4, -1),
		(-4, 3, -2),
		(3, -4, -1),
		(4, -4, -1),
		(4, -3, -2),
		(-3, -4, 0),
		(-4, -4, 1),
		(-4, -3, 1),
		(1, 4, 0),
		(4, 4, 1),
		(4, 1, 4),
		(-1, 4, -1),
		(-4, 4, -1),
		(-4, 1, -4),
		(1, -4, -1),
		(4, -4, -1),
		(4, -1, -4),
		(-1, -4, 0),
		(-4, -4, 1),
		(-4, -1, 4),
	])
	func floorDivision(args: (a: Int, b: Int, expectation: Int)) throws {
		let (a, b, expectation) = args
		#expect(BigRationalModule.floorDivision(a, b) == expectation)
	}
}

console output:

τ€Ÿˆ Iteration 5 started.
τ€Ÿˆ Suite InternalTests started.
τ€Ÿˆ Test floorDivision(args:) started.
τ€Ÿˆ Passing 1 argument args β†’ (1, 2, 0) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (-1, 2, -1) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (2, 2, 1) to floorDivision(args:)
​τ€Ÿˆ Passing 1 argument args β†’ (-2, 1, -2) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (1, -2, -1) to floorDivision(args:)
XCTest/HarnessEventHandler.swift:282: Fatal error: Internal inconsistency: No test reporter for test case argumentIDs: nil in test BigRationalModuleTests.InternalTests/floorDivision(args:)/InternalTests.swift:6:3
τ€Ÿˆ Passing 1 argument args β†’ (2, 1, 2) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (-2, 2, -1) to floorDivision(args:)
​τ€Ÿˆ Passing 1 argument args β†’ (2, -2, -1) to floorDivision(args:)
​τ€Ÿˆ Passing 1 argument args β†’ (2, -1, -2) to floorDivision(args:)
​​​​τ€Ÿˆ Passing 1 argument args β†’ (-2, -2, 1) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (-2, -1, 2) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (0, 1, 0) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (-1, -2, 0) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (0, -1, 0) to floorDivision(args:)
​​τ€Ÿˆ Passing 1 argument args β†’ (3, 4, 0) to floorDivision(args:)
​​​τ€Ÿˆ Passing 1 argument args β†’ (4, 3, 1) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (-4, 4, -1) to floorDivision(args:)
τ€Ÿˆ Passing 1 argument args β†’ (-3, 4, -1) to floorDivision(args:)
​τ€Ÿˆ Passing 1 argument args β†’ (4, 4, 1) to floorDivision(args:)

and the backtrace:

(lldb) bt
* thread #10, queue = 'com.apple.root.user-initiated-qos.cooperative', stop reason = Fatal error: Internal inconsistency: No test reporter for test case argumentIDs: nil in test BigRationalModuleTests.InternalTests/floorDivision(args:)/InternalTests.swift:6:3
  * frame #0: 0x0000000195edd890 libswiftCore.dylib`_swift_runtime_on_report
    frame #1: 0x0000000195f9cb10 libswiftCore.dylib`_swift_stdlib_reportFatalErrorInFile + 208
    frame #2: 0x0000000195b6ed94 libswiftCore.dylib`closure #1 (Swift.UnsafeBufferPointer<Swift.UInt8>) -> () in closure #1 (Swift.UnsafeBufferPointer<Swift.UInt8>) -> () in Swift._assertionFailure(_: Swift.StaticString, _: Swift.String, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never + 104
    frame #3: 0x0000000195b6ded8 libswiftCore.dylib`Swift._assertionFailure(_: Swift.StaticString, _: Swift.String, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never + 260
    frame #4: 0x00000001001224c8 libXCTestSwiftSupport.dylib`XCTest.HarnessEventHandler.testCaseEnded(_: XCTest.SwiftTestingTestCase, for: XCTest.SwiftTestingTest, at: Foundation.Date) -> () + 1852
    frame #5: 0x000000010011cedc libXCTestSwiftSupport.dylib`XCTest.HarnessEventHandler.handleEvent(_: XCTest.SwiftTestingEvent, in: XCTest.SwiftTestingEventContext) -> () + 7196
    frame #6: 0x0000000100131c20 libXCTestSwiftSupport.dylib`XCTest.SwiftTestingExecutionExtension.handleEvent(_: XCTest.SwiftTestingEvent, in: XCTest.SwiftTestingEventContext) -> () + 320
    frame #7: 0x0000000100136f20 libXCTestSwiftSupport.dylib`(2) suspend resume partial function for closure #1 @Sendable () async -> () in closure #3 @Sendable (Testing.Event, Testing.Event.Context) -> () in XCTest.SwiftTestingExecutionExtension.executeTests(_: Swift.Optional<__C.XCTTestIdentifierSet>, skipping: __C.XCTTestIdentifierSet) async throws -> Swift.Bool + 72
    frame #8: 0x00000001000f3738 libXCTestSwiftSupport.dylib`(1) await resume partial function for partial apply forwarder for reabstraction thunk helper <Ο„_0_0, Ο„_0_1 where Ο„_0_0: Swift.Sendable, Ο„_0_1 == Swift.Never> from @escaping @isolated(any) @callee_guaranteed @async () -> (@out Ο„_0_0) to @escaping @callee_guaranteed @async () -> (@out Ο„_0_0, @error @owned Swift.Error)
    frame #9: 0x00000001000f3738 libXCTestSwiftSupport.dylib`(1) await resume partial function for partial apply forwarder for reabstraction thunk helper <Ο„_0_0, Ο„_0_1 where Ο„_0_0: Swift.Sendable, Ο„_0_1 == Swift.Never> from @escaping @isolated(any) @callee_guaranteed @async () -> (@out Ο„_0_0) to @escaping @callee_guaranteed @async () -> (@out Ο„_0_0, @error @owned Swift.Error)
    frame #10: 0x00000001000f3738 libXCTestSwiftSupport.dylib`(1) await resume partial function for partial apply forwarder for reabstraction thunk helper <Ο„_0_0, Ο„_0_1 where Ο„_0_0: Swift.Sendable, Ο„_0_1 == Swift.Never> from @escaping @isolated(any) @callee_guaranteed @async () -> (@out Ο„_0_0) to @escaping @callee_guaranteed @async () -> (@out Ο„_0_0, @error @owned Swift.Error)
    frame #11: 0x00000001000f3738 libXCTestSwiftSupport.dylib`(1) await resume partial function for partial apply forwarder for reabstraction thunk helper <Ο„_0_0, Ο„_0_1 where Ο„_0_0: Swift.Sendable, Ο„_0_1 == Swift.Never> from @escaping @isolated(any) @callee_guaranteed @async () -> (@out Ο„_0_0) to @escaping @callee_guaranteed @async () -> (@out Ο„_0_0, @error @owned Swift.Error)
    frame #12: 0x00000001000f3738 libXCTestSwiftSupport.dylib`(1) await resume partial function for partial apply forwarder for reabstraction thunk helper <Ο„_0_0, Ο„_0_1 where Ο„_0_0: Swift.Sendable, Ο„_0_1 == Swift.Never> from @escaping @isolated(any) @callee_guaranteed @async () -> (@out Ο„_0_0) to @escaping @callee_guaranteed @async () -> (@out Ο„_0_0, @error @owned Swift.Error)
    frame #13: 0x000000010012be44 libXCTestSwiftSupport.dylib`(4) await resume partial function for closure #1 () async -> () in XCTest.Queue.init(named: Swift.String, priority: Swift.Optional<Swift.TaskPriority>) -> XCTest.Queue
    frame #14: 0x00000001000f3738 libXCTestSwiftSupport.dylib`(1) await resume partial function for partial apply forwarder for reabstraction thunk helper <Ο„_0_0, Ο„_0_1 where Ο„_0_0: Swift.Sendable, Ο„_0_1 == Swift.Never> from @escaping @isolated(any) @callee_guaranteed @async () -> (@out Ο„_0_0) to @escaping @callee_guaranteed @async () -> (@out Ο„_0_0, @error @owned Swift.Error)
    frame #15: 0x00000001000f3a20 libXCTestSwiftSupport.dylib`(1) await resume partial function for reabstraction thunk helper <Ο„_0_0, Ο„_0_1 where Ο„_0_0: Swift.Sendable, Ο„_0_1 == Swift.Never> from @escaping @isolated(any) @callee_guaranteed @async () -> (@out Ο„_0_0) to @escaping @callee_guaranteed @async () -> (@out Ο„_0_0, @error @owned Swift.Error)
    frame #16: 0x00000001000f3738 libXCTestSwiftSupport.dylib`(1) await resume partial function for partial apply forwarder for reabstraction thunk helper <Ο„_0_0, Ο„_0_1 where Ο„_0_0: Swift.Sendable, Ο„_0_1 == Swift.Never> from @escaping @isolated(any) @callee_guaranteed @async () -> (@out Ο„_0_0) to @escaping @callee_guaranteed @async () -> (@out Ο„_0_0, @error @owned Swift.Error)

Thanks for the report. This is a known issue in Xcode 16 and Apple is tracking it internally. It occurs when two inputs to a test function are identical. In the case of your test input, I see (-4, -4, 1) listed twice.

3 Likes

Aha! There were actually several duplicates. Thank you for pointing that out! Everything is all hunky dory now that I've cleaned that up.

It also explains the first time I encountered it. I was creating a test to make sure two different initializers resolve to the exact same value. I suppose the test crashing was another way of saying that that test passed, then :stuck_out_tongue:

I'm running into this same problem but with no arguments. Are there other known causes beyond identical input arguments?

1 Like

The fatal error also occurs, when two inputs to a test function differ by an enum case, e.g. by UIInterfaceOrientation .portrait and .landscapeLeft.

The fatal error also occurs when array contains closure instances.