Test hang or stuck after the test cases are executed. No progress further.

We are using the XCUITest Framework in one of our Apple TV Application. We have created test plans and using Jenkins for CI-CD. Once the test execution is completed, then it gets stuck and it is not stopping/completing the execution by itself.

We are having the same issue intermittently, both when running our test suite locally and when using TeamCity CI-CD.

I have only experienced this issue since upgrading to Xcode 15.

This is the difference in the log between a successful and unsuccessful test suite run (the termination message is from TeamCity):

Succesful:

15:32:49 Executed 15 tests, with 0 failures (0 unexpected) in 1145.746 (1145.831) seconds

15:32:49 2024-07-10 15:32:49.468 xcodebuild[14893:7638997] [MT] IDETestOperationsObserverDebug: 1150.195 elapsed -- Testing started completed.

15:32:49 2024-07-10 15:32:49.468 xcodebuild[14893:7638997] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start

15:32:49 2024-07-10 15:32:49.468 xcodebuild[14893:7638997] [MT] IDETestOperationsObserverDebug: 1150.195 sec, +1150.195 sec -- end

Unsuccessful:

04:01:44 Executed 15 tests, with 0 failures (0 unexpected) in 1139.079 (1139.158) seconds

04:11:31 The build iOS::Test iPad #1539 {buildId=102823} has been running for more than 30 minutes. Terminating...

Test hang or stuck after the test cases are executed. No progress further.
 
 
Q