test: retry transient doc gate reads

This commit is contained in:
udo
2026-07-14 04:34:52 +00:00
parent 2a1400b78c
commit afb17fc334
2 changed files with 29 additions and 18 deletions
+3 -1
View File
@@ -365,7 +365,9 @@ header free-functions are `inline`. The wasm backend exposes only declarations
failing group is visible before the rest of the gate runs. `doc-gate` can take failing group is visible before the rest of the gate runs. `doc-gate` can take
several minutes on a cold runtime because it compiles generated documentation several minutes on a cold runtime because it compiles generated documentation
examples; `UCE_CLI_TEST_TIMEOUT` controls the per-group curl timeout and examples; `UCE_CLI_TEST_TIMEOUT` controls the per-group curl timeout and
defaults to 900 seconds. The dependency-invalidation gate changes a transitive defaults to 900 seconds. Individual doc-page checks retry transient empty
frontend reads, but still fail persistent status, marker, compile, runtime, or
placeholder-example errors. The dependency-invalidation gate changes a transitive
`#load`, then replaces a warmed worker artifact while preserving its `#load`, then replaces a warmed worker artifact while preserving its
whole-second mtime to prove both compiler and worker caches invalidate it. It whole-second mtime to prove both compiler and worker caches invalidate it. It
also rejects an unreadable unit without publishing a wasm artifact, restores also rejects an unreadable unit without publishing a wasm artifact, restores
+26 -17
View File
@@ -214,27 +214,36 @@ void cli_run_doc_pages_gate()
continue; continue;
bool has_example = cli_doc_source_has_example(source); bool has_example = cli_doc_source_has_example(source);
String path = "/doc/index.uce?p=" + uri_encode(page); String path = "/doc/index.uce?p=" + uri_encode(page);
CliHttpResponse res = cli_frontend(path); CliHttpResponse res;
String summary; String summary;
bool ok = cli_expect_http_once(res, path, 200, "doc-detail", error_markers, summary); bool ok = false;
String lower = to_lower(res.body); for(u64 attempt = 0; attempt < 3; attempt++)
if(has_example)
{ {
if(!cli_contains(res.body, "class=\"example-output\"") || !cli_contains(res.body, "example-output-label\">Output")) if(attempt > 0)
usleep(500000);
res = cli_frontend(path);
ok = cli_expect_http_once(res, path, 200, "doc-detail", error_markers, summary);
String lower = to_lower(res.body);
if(has_example)
{ {
ok = false; if(!cli_contains(res.body, "class=\"example-output\"") || !cli_contains(res.body, "example-output-label\">Output"))
summary += "; missing example Output block"; {
} ok = false;
if(cli_contains(lower, "doc example error")) summary += "; missing example Output block";
{ }
ok = false; if(cli_contains(lower, "doc example error"))
summary += "; example reported an error"; {
} ok = false;
if(cli_doc_example_is_placeholder(source)) summary += "; example reported an error";
{ }
ok = false; if(cli_doc_example_is_placeholder(source))
summary += "; placeholder example (must exercise the API)"; {
ok = false;
summary += "; placeholder example (must exercise the API)";
}
} }
if(ok)
break;
} }
cli_test_case("uce_doc_gate:doc page " + page, ok, ok ? summary : summary + "; body=" + cli_truncate(res.body)); cli_test_case("uce_doc_gate:doc page " + page, ok, ok ? summary : summary + "; body=" + cli_truncate(res.body));
} }