feat(worker): run a continuous queue loop
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 9s
VoidBuildSystem CI / sanitizers-gcc16 (push) Failing after 7s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 13s
VoidBuildSystem CI / wine-windows-gcc16 (push) Failing after 56s

This commit is contained in:
faumaray committed 2026-12-05 11:47:03 +03:00
1 parent 4f3701c740
commit 8dac19c3ea
5 files changed
+139 -70

No files matched your search

+19
View File
@@ -2151,6 +2151,25 @@ VOID_TEST(RegistryTests, worker_cli_leases_publishes_and_reports_result) {
if (queue_state) {
Void::Testing::expect(queue_state->body.find("\"pending\":[]") != std::string::npos);
}
// Continuous loop: process every queued action (record from the local state) and exit
// when the queue drains.
auto enqueued_again = send_loopback_http(port, "POST", "/api/v1/queue", auth,
"{\"action_keys\":[\"" + action_key + "\"]}");
Void::Testing::expect(enqueued_again.has_value() && enqueued_again->status == 200);
Platform::ProcessRequest loop_worker = worker;
loop_worker.arguments = {
"worker", "--registry", reg_url, "--build-dir", (tmp / "build").string(), "--queue"};
auto loop_res = Platform::run_supervised(loop_worker);
Void::Testing::expect_eq(loop_res ? (loop_res->succeeded()
? std::string{}
: (loop_res->stdout_data + loop_res->stderr_data))
: loop_res.error().message(),
std::string{});
if (loop_res) {
Void::Testing::expect(loop_res->stdout_data.find("queue empty") != std::string::npos);
Void::Testing::expect(loop_res->stdout_data.find(action_key) != std::string::npos);
}
(*svc)->stop_http();
}