Skip to content
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

Move scalanative.runtime.loop() invocation to correct place #700

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

armanbilge
Copy link
Contributor

@armanbilge armanbilge commented Sep 15, 2023

#693 had the right idea, but it was invoking scalanative.runtime.loop() in the wrong place. We should use it to Await.result on a Future.

Resolves #695

val reporter =
new JUnitReporter(eventHandler, loggers, runSettings, taskDef())
val notifier: RunNotifier = new MUnitRunNotifier(reporter)
runner.run(notifier)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

JS uses runAsync here but actually we want to use run (sync) on Native.

Comment on lines +16 to +19
def awaitResult[T](awaitable: Awaitable[T]): T = {
scalanative.runtime.loop()
Await.result(awaitable, Duration.Inf)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@valencik valencik left a comment

Choose a reason for hiding this comment

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

Published locally and tested against all our various reproducers and it worked swimmingly!

@valencik valencik merged commit bc67c6c into scalameta:main Sep 15, 2023
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 this pull request may close these issues.

Broken Scala Native tests on v1.0.0-M9
2 participants