Fix flaky //scouting/webserver/requests/debug/cli:cli_test
We're seeing timeouts in this test. After adding some debugging, it
looks like it's fixed by making stronger guarantees about the startup
order. Every once in a while the scouting server started up faster
than the fake TBA server and fail to scrape the data. Since we only
scrape the data every 10 minutes, the test times out before scraping
completes.
The fix here is to start the fake TBA server before the webserver.
That lets the webserver scrape successfully on startup.
I left the additional debugging in place because it might be helpful
in the future.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Ibe32b0e622319ff4813c056054aea8543e4ae2e2
diff --git a/scouting/webserver/requests/debug/cli/BUILD b/scouting/webserver/requests/debug/cli/BUILD
index 371f66e..ebc23b3 100644
--- a/scouting/webserver/requests/debug/cli/BUILD
+++ b/scouting/webserver/requests/debug/cli/BUILD
@@ -25,9 +25,13 @@
py_test(
name = "cli_test",
+ size = "small",
srcs = [
"cli_test.py",
],
+ args = [
+ "-v",
+ ],
data = [
":cli",
],
diff --git a/scouting/webserver/requests/debug/cli/cli_test.py b/scouting/webserver/requests/debug/cli/cli_test.py
index 4e47b2d..979ef5a 100644
--- a/scouting/webserver/requests/debug/cli/cli_test.py
+++ b/scouting/webserver/requests/debug/cli/cli_test.py
@@ -89,6 +89,10 @@
sys.stderr.write(
f"Waiting until {expected_num_matches} are imported. "
f"Currently at {num_matches_imported}.\n")
+ else:
+ sys.stderr.write(
+ "Failed to parse requestAllMatches for number of "
+ f"matches: {stdout}\n")
time.sleep(0.25)