6.1 test paralel with code coverage throw an error in llvm-profdata

Helo,

This weekend I tried to upgrade my app to swift 6.1, and I stumb into an error in the pipeline, with a huge stack-trace. After trying it in my local machine I found that this is generates a counter overflow when I run my tests with code-coverage enabled and also in parallel.

This is a small part of the full stacktrace, Seems some case of recursivity at first look.

error: terminated(1): /usr/bin/llvm-profdata merge -sparse /__w/mr-scrooge/mr-scrooge/.build/aarch64-unknown-linux-gnu/debug/codecov/XCTest13463496829016464912_0.profraw '/__w/mr-scrooge/mr-scrooge/.build/aarch64-unknown-linux-gnu/debug/codecov/Swift Testing13463496829016464912_0.profraw' -o /__w/mr-scrooge/mr-scrooge/.build/aarch64-unknown-linux-gnu/debug/codecov/default.profdata output:
    /__w/mr-scrooge/mr-scrooge/.build/aarch64-unknown-linux-gnu/debug/codecov/XCTest13463496829016464912_0.profraw: $s7Atomics20AtomicUpdateOrderingV9_rawValueACSi_tcfC: counter overflow
    /__w/mr-scrooge/mr-scrooge/.build/aarch64-unknown-linux-gnu/debug/codecov/XCTest13463496829016464912_0.profraw: $s7Atomics19_AtomicInt64StorageVyACBi64_cfC: counter overflow
    /__w/mr-scrooge/mr-scrooge/.build/aarch64-unknown-linux-gnu/debug/codecov/XCTest13463496829016464912_0.profraw: $s7Atomics20AtomicUpdateOrderingV2eeoiySbAC_ACtFZ: counter overflow

In my tests I've got XC test cases and Swift Testing cases (Just started migrating stuff)

You can see the full Stack Trace here:

Any Idea if this is a known error? Also some workarround to make it working?

Thanks,
Jaume.

1 Like

I can confirm the error comes from the mixed SwiftTesting with XCTest, once I moved everything to swiftTesting, the tests are green again with 6.1 (well, I've got some issue when runing in paralle, but nothing big) Should I create an issue in swift?

Just adding a +1 for this issue. We are seeing it as well in various repos with mixed XCTest and SwiftTesting test cases.

1 Like

Then, I will try to create a ticket in swiftlang this afternoon. I think I've got some sample/empty project with mixed tests

Sharing another clue. I am able to reproduce this from within a swift:6.1 linux container with two different packages that do not have mixed test cases, only XCTests cases. The llvm-profdata merge failure seems to be correlated with the presence of the --parallel flag.