Skip to content

Commit 7c78287

Browse files
authored
Merge pull request scala#78 from gourlaysama/array-iob-exception
Add synchronization when sending events to sbt (fix ArrayIOBException).
2 parents cd9319f + 1dc1f5a commit 7c78287

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/partest/scala/tools/partest/sbt/SBTRunner.scala

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,18 @@ class SBTRunner(val config: RunnerSpec.Config,
6464
javacCmdPath = Option(javacCmd).map(_.getAbsolutePath) getOrElse PartestDefaults.javacCmd,
6565
scalacExtraArgs = scalacArgs,
6666
javaOpts = javaOpts,
67-
scalacOpts = scalacOpts) {
67+
scalacOpts = scalacOpts) { self =>
6868

6969
override def onFinishTest(testFile: File, result: TestState): TestState = {
70-
eventHandler.handle(new Event {
71-
def fullyQualifiedName: String = testFile.testIdent
72-
def fingerprint: Fingerprint = partestFingerprint
73-
def selector: Selector = new TestSelector(testFile.testIdent)
74-
val (status, throwable) = makeStatus(result)
75-
def duration: Long = -1
76-
})
70+
self.synchronized {
71+
eventHandler.handle(new Event {
72+
def fullyQualifiedName: String = testFile.testIdent
73+
def fingerprint: Fingerprint = partestFingerprint
74+
def selector: Selector = new TestSelector(testFile.testIdent)
75+
val (status, throwable) = makeStatus(result)
76+
def duration: Long = -1
77+
})
78+
}
7779
result
7880
}
7981
}

0 commit comments

Comments
 (0)