-
Notifications
You must be signed in to change notification settings - Fork 323
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
More reliable shutdown of the EnsoContext to save resources #6468
Changes from 6 commits
adb14bd
d36df22
5b08bcf
ae3050e
f71557d
c3dd09c
d3619db
52077c1
ea3e53b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,6 +331,11 @@ class RuntimeServerTest | |
val Some(Api.Response(_, Api.InitializedNotification())) = context.receive | ||
} | ||
|
||
override protected def afterEach(): Unit = { | ||
context.executionContext.context.close() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This helps the "engine threads", but the test should also stop Akka, @4e6. Dmitry, if you know how to do that feel free to directly commit to this branch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're not using Akka in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was wrong, in fact, runtime tests are using Akka. |
||
context.runtimeServerEmulator.terminate() | ||
} | ||
|
||
"RuntimeServer" should "push and pop functions on the stack" in { | ||
val contents = context.Main.code | ||
val mainFile = context.writeMain(contents) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,4 +80,6 @@ class RuntimeServerEmulator( | |
} | ||
} else null | ||
} | ||
|
||
def terminate() = system.terminate() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I added all these
afterEach
cleanups, running the wholesbt runtime-with-instruments/test
started to randomly fail. Turned out I had to also f71557d - e.g. wait for theshutdown
of theEnsoContext
threads.