feat(worker): lease queued actions in vbs worker
VoidBuildSystem CI / sanitizers-gcc16 (push) Failing after 3s
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 4s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 32s
VoidBuildSystem CI / wine-windows-gcc16 (push) Failing after 52s

This commit is contained in:
faumaray committed 2026-12-05 11:36:17 +03:00
1 parent 2776e459e3
commit 452b2e315d
7 files changed
+107 -10

No files matched your search

+25
View File
@@ -2126,6 +2126,31 @@ VOID_TEST(RegistryTests, worker_cli_leases_publishes_and_reports_result) {
if (cas_blob) {
Void::Testing::expect(cas_blob->body == "WORKER_OUTPUT");
}
// Queue-driven mode: the worker leases the next queued key instead of --action-key.
auto enqueued = send_loopback_http(port, "POST", "/api/v1/queue", auth,
"{\"action_keys\":[\"" + action_key + "\"]}");
Void::Testing::expect(enqueued.has_value() && enqueued->status == 200);
Platform::ProcessRequest queued_worker = worker;
queued_worker.arguments = {"worker",
"--registry",
reg_url,
"--record",
record_file.string(),
"--build-dir",
(tmp / "build").string(),
"--queue"};
auto queued_res = Platform::run_supervised(queued_worker);
Void::Testing::expect_eq(
queued_res ? (queued_res->succeeded() ? std::string{}
: (queued_res->stdout_data + queued_res->stderr_data))
: queued_res.error().message(),
std::string{});
auto queue_state = send_loopback_http(port, "GET", "/api/v1/queue", auth);
Void::Testing::expect(queue_state.has_value() && queue_state->status == 200);
if (queue_state) {
Void::Testing::expect(queue_state->body.find("\"pending\":[]") != std::string::npos);
}
(*svc)->stop_http();
}