@@ -23,23 +23,30 @@ class PosixPluginFrontendSpec extends AnyFlatSpec with Matchers {
23
23
toReceive
24
24
}
25
25
}
26
- val (path, state) = PosixPluginFrontend .prepare(
27
- fakeGenerator,
28
- env
29
- )
30
- val actualOutput = new ByteArrayOutputStream ()
31
- val process = sys.process
32
- .Process (path.toAbsolutePath.toString)
33
- .run(new ProcessIO (writeInput => {
34
- writeInput.write(toSend)
35
- writeInput.close()
36
- }, processOutput => {
37
- IOUtils .copy(processOutput, actualOutput)
38
- processOutput.close()
39
- }, _.close()))
40
- process.exitValue()
41
- actualOutput.toByteArray mustBe toReceive
42
- PosixPluginFrontend .cleanup(state)
26
+
27
+ // Repeat 10,000 times since named pipes on macOS are flaky.
28
+ val repeatCount = 10000
29
+ for (i <- 1 to repeatCount) {
30
+ if (i % 100 == 1 ) println(s " Running iteration $i of $repeatCount" )
31
+
32
+ val (path, state) = PosixPluginFrontend .prepare(
33
+ fakeGenerator,
34
+ env
35
+ )
36
+ val actualOutput = new ByteArrayOutputStream ()
37
+ val process = sys.process
38
+ .Process (path.toAbsolutePath.toString)
39
+ .run(new ProcessIO (writeInput => {
40
+ writeInput.write(toSend)
41
+ writeInput.close()
42
+ }, processOutput => {
43
+ IOUtils .copy(processOutput, actualOutput)
44
+ processOutput.close()
45
+ }, _.close()))
46
+ process.exitValue()
47
+ actualOutput.toByteArray mustBe toReceive
48
+ PosixPluginFrontend .cleanup(state)
49
+ }
43
50
}
44
51
}
45
52
}
0 commit comments