diff options
author | aosagie <osagie@gmail.com> | 2018-09-02 02:21:35 -0400 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-09-02 14:21:35 +0800 |
commit | a6efead6bafd34a7c55a58e3dc5d6267345672f1 (patch) | |
tree | b8b2c9fbc62a2e6378a258f32544ae5aba36962f /scalalib/src | |
parent | ed95f2dd558a82f6b84f7f0dc3d80b3038683950 (diff) | |
download | mill-a6efead6bafd34a7c55a58e3dc5d6267345672f1.tar.gz mill-a6efead6bafd34a7c55a58e3dc5d6267345672f1.tar.bz2 mill-a6efead6bafd34a7c55a58e3dc5d6267345672f1.zip |
Fix shutdown hook failures in tests (#422)
* Remove duplication from ClassLoader.create
* Prevent closing of context class loader in tests so that shutdown hooks can run
Diffstat (limited to 'scalalib/src')
-rw-r--r-- | scalalib/src/mill/scalalib/TestRunner.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scalalib/src/mill/scalalib/TestRunner.scala b/scalalib/src/mill/scalalib/TestRunner.scala index 1ea819ac..947021ba 100644 --- a/scalalib/src/mill/scalalib/TestRunner.scala +++ b/scalalib/src/mill/scalalib/TestRunner.scala @@ -68,7 +68,8 @@ object TestRunner { testClassfilePath: Agg[Path], args: Seq[String]) (implicit ctx: Ctx.Log with Ctx.Home): (String, Seq[mill.scalalib.TestRunner.Result]) = { - Jvm.inprocess(entireClasspath, classLoaderOverrideSbtTesting = true, isolated = true, cl => { + //Leave the context class loader set and open so that shutdown hooks can access it + Jvm.inprocess(entireClasspath, classLoaderOverrideSbtTesting = true, isolated = true, closeContextClassLoaderWhenDone = false, cl => { val frameworks = frameworkInstances(cl) val events = mutable.Buffer.empty[Event] |