test: retry cold site suite probes
This commit is contained in:
parent
1d6c882fb7
commit
c73dbc8503
@ -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, "<div class=\"tests-summary\">") && !cli_contains(lower, ">failed 0</span>"))
|
||||
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, "<div class=\"tests-summary\">") && !cli_contains(lower, ">failed 0</span>"))
|
||||
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, "<div class=\"tests-summary\">") ? "yes" : "no") + "; failed_zero=" + (cli_contains(lower, ">failed 0</span>") ? "yes" : "no") + "; body=" + cli_truncate(res.body);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user