swift-async-algorithms
swift-async-algorithms copied to clipboard
test_bufferingOldest_error fails with an unexpected set of values.
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.
test_bufferingNewest_error also fails intermittently
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.
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).
Closing this since we have reimplemented buffer since then and the tests are passing.