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

Test sleeping in both tasks of Task.select.

Open mbrandonw opened this issue 3 years ago • 2 comments

This makes it so that each task in Task.select sleeps so that we get test coverage on the behavior I saw in #139 where the task would hang forever. The task does not hang forever if one of the selections is a non-awaiting block of code.

We don't need to sleep for any significant amount of time. I chose 100 microseconds, but it could even be a 0 duration sleep.

mbrandonw avatar May 04 '22 19:05 mbrandonw

Hi @phausler, I created this a few days ago in case you are interested. This is the test that would have stalled forever until the clock fixes you made.

mbrandonw avatar May 10 '22 14:05 mbrandonw

@swift-ci please test

phausler avatar May 17 '22 15:05 phausler

Task.select was removed since it caused design patterns to push to sendable iterators. So this is not needed anymore.

phausler avatar Nov 16 '22 18:11 phausler