8000 Fix flaky testTaskCancel_whenStreaming_andNotSuspended by FranzBusch · Pull Request #2355 · apple/swift-nio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix flaky testTaskCancel_whenStreaming_andNotSuspended #2355

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2023

Conversation

FranzBusch
Copy link
Member

Motivation

Currently testTaskCancel_whenStreaming_andNotSuspended is flaky since didTerminate can be called after the iterator is dropped. Fixes #2354

Modification

Let's modify that slightly so we hight the condition we want to hit.

Result

No more flaky tests.

@glbrntt glbrntt added the semver/none No version bump required. label Jan 23, 2023
let value = await iterator.next()

// Sleeping here a bit to make sure we hit the
try? await Task.sleep(nanoseconds: 500_000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 500 microseconds sufficient?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to 1 ms and 2 ms. That should be enough

# Motivation
Currently `testTaskCancel_whenStreaming_andNotSuspended` is flaky since `didTerminate` can be called after the iterator is dropped. Fixes apple#2354

# Modification
Let's modify that slightly so we hight the condition we want to hit.

# Result
No more flaky tests.
@Lukasa Lukasa merged commit 45167b8 into apple:main Jan 25, 2023
@FranzBusch FranzBusch deleted the fb-fix-test branch January 25, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test: NIOAsyncSequenceProducerTests.testTaskCancel_whenStreaming_andNotSuspended
3 participants
0