Skip to content

Nondeterministic test failure with AsyncStream + Dispatch interop #21

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

Open
jakepetroules opened this issue Jan 31, 2025 · 0 comments · May be fixed by #486
Open

Nondeterministic test failure with AsyncStream + Dispatch interop #21

jakepetroules opened this issue Jan 31, 2025 · 0 comments · May be fixed by #486

Comments

@jakepetroules
Copy link
Collaborator

Occasionally tests such as linkerSignedBinaryDetection will fail with an error message like:

Caught error: dataStream(reading: DispatchFD(rawValue: 9))#1(): Is a directory (21)

This is due to the file descriptor that is read from in Dispatch+Async.swift becoming invalid, but it's not clear why this happens.

jakepetroules added a commit that referenced this issue Apr 18, 2025
Noticed this during a bit of investigation into #21, and don't necessarily expect this to fix it, but it seems correct in order to prevent the fd possibly being closed while the stream is still being read.
jakepetroules added a commit that referenced this issue Apr 18, 2025
Noticed this during a bit of investigation into #21, and don't necessarily expect this to fix it, but it seems correct in order to prevent the fd possibly being closed while the stream is still being read.
jakepetroules added a commit that referenced this issue May 5, 2025
Stress testing this approach over use of a long-lived DispatchIO channel appears to resolve the nondeterministic failures with the file descriptor being destroyed, and is easier to reason about.

Closes #21
@jakepetroules jakepetroules linked a pull request May 5, 2025 that will close this issue
jakepetroules added a commit that referenced this issue May 6, 2025
Stress testing this approach over use of a long-lived DispatchIO channel appears to resolve the nondeterministic failures with the file descriptor being destroyed, and is easier to reason about.

Closes #21
jakepetroules added a commit that referenced this issue May 10, 2025
Stress testing this approach over use of a long-lived DispatchIO channel appears to resolve the nondeterministic failures with the file descriptor being destroyed, and is easier to reason about.

Closes #21
jakepetroules added a commit that referenced this issue May 11, 2025
Stress testing this approach over use of a long-lived DispatchIO channel appears to resolve the nondeterministic failures with the file descriptor being destroyed, and is easier to reason about.

Closes #21
jakepetroules added a commit that referenced this issue May 11, 2025
Stress testing this approach over use of a long-lived DispatchIO channel appears to resolve the nondeterministic failures with the file descriptor being destroyed, and is easier to reason about.

Closes #21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant