swift-async-algorithms icon indicating copy to clipboard operation
swift-async-algorithms copied to clipboard

test_bufferingOldest_error fails with an unexpected set of values.

Open phausler opened this issue 1 year ago • 3 comments

swift-async-algorithms/Tests/AsyncAlgorithmsTests/TestBuffer.swift:454: error: -[AsyncAlgorithmsTests.TestBuffer test_bufferingOldest_error] : specification violation got "5" after iteration terminated at tick 7
swift-async-algorithms/Tests/AsyncAlgorithmsTests/TestBuffer.swift:454: error: -[AsyncAlgorithmsTests.TestBuffer test_bufferingOldest_error] : expected failure but got "3" at tick 7
swift-async-algorithms/Tests/AsyncAlgorithmsTests/TestBuffer.swift:454: error: -[AsyncAlgorithmsTests.TestBuffer test_bufferingOldest_error] : unexpected "4" at tick 7
swift-async-algorithms/Tests/AsyncAlgorithmsTests/TestBuffer.swift:454: error: -[AsyncAlgorithmsTests.TestBuffer test_bufferingOldest_error] : unexpected finish at tick 7
swift-async-algorithms/Tests/AsyncAlgorithmsTests/TestBuffer.swift:451: error: -[AsyncAlgorithmsTests.TestBuffer test_bufferingOldest_error] : failed - Validation failure:
Expected:
X------[12^]
Actual:
X------[1234|]

This needs to be determined if this is a valid failure or an invalid test.

phausler avatar Sep 29 '22 16:09 phausler

test_bufferingNewest_error also fails intermittently

phausler avatar Oct 10 '22 16:10 phausler

Stepping through this in the debugger usually sees it succeed, which sounds like a race condition to me. I've also noticed a similar issue in TestManualClock.test_sleep(), so I wonder if the race isn't happening in there.

AlanQuatermain avatar Oct 13 '22 18:10 AlanQuatermain

Actually, it seems the test_sleep() method fails most of the time when running all the tests in TestManualClock, but succeeds most of the time when running it on its own. This is all in Xcode btw (14A6270e, if that might matter).

AlanQuatermain avatar Oct 13 '22 18:10 AlanQuatermain