diff --git a/site/tests/cli_runner.uce b/site/tests/cli_runner.uce index 911b5e7..247ee79 100644 --- a/site/tests/cli_runner.uce +++ b/site/tests/cli_runner.uce @@ -274,17 +274,13 @@ void cli_run_site_suite() String file = trim(parts[0]); String title = trim(parts[1]); String expected = first(trim(parts[4]), title); - CliHttpResponse res = cli_frontend("/tests/" + file); - String lower = to_lower(res.body); - bool ok = res.status == 200 && cli_contains(res.body, expected); - for(String marker : { "compile error", "runtime error", "timed out acquiring compile lock", "near line" }) - if(cli_contains(lower, marker)) - ok = false; - if(cli_contains(lower, "
") && !cli_contains(lower, ">failed 0")) - ok = false; - if(!ok && file == "services.uce") + CliHttpResponse res; + String lower; + bool ok = false; + for(u64 attempt = 0; attempt < 3; attempt++) { - usleep(1000000); + if(attempt > 0) + usleep(1000000); res = cli_frontend("/tests/" + file); lower = to_lower(res.body); ok = res.status == 200 && cli_contains(res.body, expected); @@ -293,6 +289,8 @@ void cli_run_site_suite() ok = false; if(cli_contains(lower, "
") && !cli_contains(lower, ">failed 0")) ok = false; + if(ok) + break; } String name = "uce_site_suite:site tests " + (file == "index.uce" ? "index" : file == "io.uce" ? "filesystem" : file == "websockets.ws.uce" ? "websockets page" : replace(replace(replace(file, ".uce", ""), ".ws", ""), "_", " ")); String fail_detail = "; status=" + std::to_string(res.status) + "; expected_marker=" + (cli_contains(res.body, expected) ? "yes" : "no") + "; summary=" + (cli_contains(lower, "
") ? "yes" : "no") + "; failed_zero=" + (cli_contains(lower, ">failed 0") ? "yes" : "no") + "; body=" + cli_truncate(res.body);