JSEnvs are only closed after all tests are run in aggregate project
See original GitHub issueAs stated in the README
Executing
test
will open several browser windows and close them all before the end of the tests.
This behavior seems to cause spawning a lot of browser processes when running test
in an aggregate project, which are only stopped after all tests have finished.
Since switching to Firefox in https://github.com/softwaremill/tapir/pull/860 due to scala-js/scala-js-env-selenium#119/#105, this causes issues on memory constrained CI runners. Firefox seems to be a bit more memory hungry than Chrome, so we’re only seeing this now but the behavior is the same in Chrome as well.
Is there a way to terminate browser processes after each test run or after the tests of single subproject have finished, when running test on an aggregate project in sbt?
Note that in parallel execution is already disabled in the build:
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
Test / parallelExecution := false
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
This is unfortunately another shortcoming of
sbt.testing._
(although a much more subtle one): There is no resource cleanup hook for resources shared between multipleFramework
s.In Scala.js’ sbt plugin, we might have the option to intercept sbt’s testing infrastructure more deeply and get a better point to call
TestAdapter#close()
.The obvious downside of this would of course be that we’d rely on much more internal details of how sbt executes tests.
IMHO, this is a Scala.js core issue (notably, it is, in my opinion, not an issue with the
JSEnv
interface). Unless there are objections, I’ll transfer this issue to scala-js/scala-js.After having attempted to build said heuristic, I’m not comfortable proceeding: From what I can see, it has the potential to worsen currently working use cases (notably the workaround to this very issue).