Skip to content

Commit 1135bac

Browse files
committed
Reduce acceptTimeout
I noticed that my tests were very slow to start running. While running with sbt | ts '%H:%M:%.S', I found that there was almost always exactly a 5 second delay between starting the process and the first output being printed. I grepped for 5000 and found this line. Changing this parameter eliminated the delay for me. The parameter seems to only be used in the awaitConnection method, which just loops until serverSocket.accept succeeds (with failure being a socket timeout). This makes me fairly confident that this change won't break anything. I also would expect any additional overhead of the extra thread wake ups to be negligible.
1 parent 52c8510 commit 1135bac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js-envs/src/main/scala/org/scalajs/jsenv/nodejs/AbstractNodeJSEnv.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ abstract class AbstractNodeJSEnv(
5151
}
5252

5353
/** Retry-timeout to wait for the JS VM to connect */
54-
protected val acceptTimeout = 5000
54+
protected val acceptTimeout = 500
5555

5656
protected trait AbstractNodeRunner extends AbstractExtRunner with JSInitFiles {
5757

0 commit comments

Comments
 (0)