Skip to content

remove non-deterministic cancellation of async TASTy in sbt-test #20319

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
May 2, 2024

Conversation

bishabosha
Copy link
Member

@bishabosha bishabosha commented May 2, 2024

how-i-fixed-it:

Originally these tests were written before we implemented async TASTy writing. This meant that we blocked the main thread at the end of ExtractAPI until TASTy was written. This meant that -Ystop-after:firstTransform would prevent the compiler reaching the backend, but stop after we knew that TASTy was written to a-early.jar

Originally we did this to explicitly communicate that TASTy comes from a-early.jar, rather than genBCode output. In reality, it doesn't assert anything stronger than a comment would, because we manually fix the classpath to only be a-early.jar.

After we added async TASTy writing, this test became non-deterministic, because we cancel async TASTy writing at the end of a run without synchronizing. So it's possible TASTy isn't written by the time we cancel after firstTransform.

So instead, we remove -Ystop-after, guaranteeing that a/compile does not finish until we synchronize async TASTy in genBCode.

fixes #20306
fixes #20278

how-i-fixed-it:

Originally these tests were written before we
implemented async TASTy writing. This meant that we blocked the
main thread at the end of ExtractAPI until TASTy was written.

This meant that -Ystop-after:firstTransform would prevent the
compiler reaching the backend, but stop after we knew that TASTy
was written to a-early.jar

Originally we did this to explicitly communicate that TASTy comes
from a-early.jar, rather than genBCode output.
In reality, it doesn't assert anything stronger than a comment would,
because we manually fix the classpath to only be a-early.jar.

After we added async TASTy writing, this test became non-deterministic,
because we cancel async TASTy writing at the end of a run
without synchronizing. So its possible TASTy isn't written
by the time we cancel after firstTransform.

So instead, we remove -Ystop-after, guaranteeing that 'a/compile' does not
finish until we synchronize async TASTy in genBCode.
@hamzaremmal hamzaremmal enabled auto-merge May 2, 2024 09:33
@hamzaremmal hamzaremmal merged commit cb554eb into scala:main May 2, 2024
18 checks passed
@hamzaremmal hamzaremmal deleted the fix-flaky-ci branch May 2, 2024 10:55
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nightly Dotty workflow of 2024-05-01 failed Nightly Dotty workflow of 2024-04-28 failed
3 participants