Fix flakiness of //scouting:scouting_test
I ran the `//scouting:scouting_test` 10'000 and got 6 failures.
They all had messages like this:
2022/03/13 23:41:36 Error calling ListenAndServe(): listen tcp :36144: bind: address already in use
The protractor framework finds a random port for the webserver to use.
After it finds an available port, it starts the webserver and tells it
about the port to use with the `--port` argument. The problem here is
that before the webserver has a chance to claim the port, another
process that grabs random ports can come in and claim the same port.
This patch fixes the race condition by using the fixed port of 6060.
This port is outside of the random port search window of the other
processes so it should not interfere.
After this patch, running the test 10'000 times produced 0 failures.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I5b415114d09d4af8862116a8df90f40e084f9218
diff --git a/WORKSPACE b/WORKSPACE
index f574965..eb250cf 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -767,6 +767,10 @@
name = "npm",
frozen_lockfile = True,
package_json = "//:package.json",
+ patch_args = ["-p1"],
+ post_install_patches = [
+ "//third_party:npm/@bazel/protractor/bazel-protractor.patch",
+ ],
symlink_node_modules = False,
yarn_lock = "//:yarn.lock",
)