feat(registry,daemon): ETag downloads; report pending changes
This commit is contained in:
1 parent
fdfab9277b
commit
85ff7a8c75
8 files changed
+65
-3
No files matched your search
@@ -162,6 +162,7 @@ VOID_TEST(Daemon, lifecycle_ping_status_gc_shutdown_and_unknown_op) {
|
||||
Void::Testing::expect(int_field(*status_object, "pid") > 0);
|
||||
Void::Testing::expect(int_field(*status_object, "watched_directories") >= 1);
|
||||
Void::Testing::expect(int_field(*status_object, "sequence") >= 0);
|
||||
Void::Testing::expect(int_field(*status_object, "pending_changes") >= 0);
|
||||
|
||||
auto gc = Void::Build::Daemon::request(socket, R"({"op":"gc","max_bytes":0})");
|
||||
Void::Testing::require(gc.has_value());
|
||||
@@ -690,11 +691,17 @@ VOID_TEST(Daemon, watch_poll_reports_changed_paths) {
|
||||
std::jthread worker{[&] { run_result = server->run(); }};
|
||||
Void::Testing::require(wait_for_path(socket, std::chrono::seconds{5}));
|
||||
|
||||
auto initial_status = request_object(socket, R"({"op":"status"})");
|
||||
Void::Testing::require(initial_status.has_value());
|
||||
Void::Testing::expect_eq(int_field(*initial_status, "pending_changes"), std::int64_t{0});
|
||||
|
||||
{
|
||||
std::ofstream probe{options.project_root / "probe.txt"};
|
||||
probe << "changed\n";
|
||||
Void::Testing::require(probe.good());
|
||||
}
|
||||
// Let every inotify event from the write queue up so one poll drains them all.
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds{50});
|
||||
|
||||
bool saw_probe = false;
|
||||
for (int attempt = 0; attempt < 100 && !saw_probe; ++attempt) {
|
||||
@@ -711,6 +718,10 @@ VOID_TEST(Daemon, watch_poll_reports_changed_paths) {
|
||||
}
|
||||
Void::Testing::expect(saw_probe);
|
||||
|
||||
auto drained_status = request_object(socket, R"({"op":"status"})");
|
||||
Void::Testing::require(drained_status.has_value());
|
||||
Void::Testing::expect_eq(int_field(*drained_status, "pending_changes"), std::int64_t{0});
|
||||
|
||||
auto shutdown = Void::Build::Daemon::request(socket, R"({"op":"shutdown"})");
|
||||
Void::Testing::expect(shutdown.has_value());
|
||||
worker.join();
|
||||
|
||||
Reference in new issue
Block a user