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

Several tests fail or hang on linux with the official trunk snapshot toolchains

Open finagolfin opened this issue 2 years ago • 5 comments

I see this both on linux x86_64 and Android AArch64. Is there no linux CI for this repo?

finagolfin avatar Feb 16 '23 18:02 finagolfin

Are you still seeing this issue?

FranzBusch avatar Feb 21 '23 13:02 FranzBusch

Yes, I see several tests hanging and failing on linux x86_64 with the latest Feb. 21 official trunk snapshot build for Ubuntu 20.04 x86_64 testing the latest trunk commit ffa6ee9. In particular, these tests all hang on Android AArch64 also:

AsyncAlgorithmsTests.TestCombineLatest2/test_throwing_ordering1
AsyncAlgorithmsTests.TestCombineLatest2/test_throwing_ordering2
AsyncAlgorithmsTests.TestZip2/test_zip_produces_one_element_and_throws_when_first_produces_one_element_and_throws
AsyncAlgorithmsTests.TestZip2/test_zip_produces_one_element_and_throws_when_second_produces_one_element_and_throws
AsyncAlgorithmsTests.TestZip3/test_zip_produces_one_element_and_throws_when_first_produces_one_element_and_throws
AsyncAlgorithmsTests.TestZip3/test_zip_produces_one_element_and_throws_when_second_produces_one_element_and_throws
AsyncAlgorithmsTests.TestZip3/test_zip_produces_one_element_and_throws_when_third_produces_one_element_and_throws

A handful more also fail, let me know if you cannot reproduce.

finagolfin avatar Feb 22 '23 16:02 finagolfin

This PR should fix it: https://github.com/apple/swift-async-algorithms/pull/254

FranzBusch avatar Feb 27 '23 14:02 FranzBusch

I'm still seeing a few sporadically hanging tests on Android AArch64, particularly if all the tests are run in parallel. This is when building the latest trunk commit from a couple weeks ago, e6b21d2.

I just cross-compiled the latest trunk snapshot toolchain for Android AArch64 and the following test hung once out of 10 runs of swift test --parallel:

TestBuffer/test_given_a_buffered_bounded_sequence_when_cancelling_consumer_then_the_iteration_finishes_and_the_base_is_cancelled

I also tried running 10 times with the last March 16 trunk source snapshot that I built natively on my Android phone, and that previous test hung once and this test hung once:

TestZip2/test_zip_finishes_when_iteration_task_is_cancelled

finagolfin avatar Mar 22 '23 06:03 finagolfin

@buttaface Thanks for raising. This these tests are problematic because they are using test expectations which just don't work nicely in async methods. We should refactor these tests to become deterministic. This can be achieved with using AsyncStream etc.

FranzBusch avatar Mar 22 '23 12:03 FranzBusch