From cece7edf6e24d4575c26ce53c1dcc1e30e0fa95b Mon Sep 17 00:00:00 2001 From: Tyler Reckart Date: Mon, 21 Sep 2026 09:44:09 -0400 Subject: [PATCH] Remove leftover merge conflict markers from unit tests. #358 and #325 squash-merged unresolved conflict blocks into the schedule parser and sandbox SSRF tests, so a clean main build failed at compile time. Co-authored-by: Cursor --- tests/test_sandbox_ssrf.cpp | 31 ------------------------------- tests/test_schedule_parser.cpp | 5 ++--- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/tests/test_sandbox_ssrf.cpp b/tests/test_sandbox_ssrf.cpp index d87f72f5..41532fb0 100644 --- a/tests/test_sandbox_ssrf.cpp +++ b/tests/test_sandbox_ssrf.cpp @@ -162,7 +162,6 @@ TEST_CASE("sandbox read: O_NOFOLLOW refuses leaf symlink swap after resolve") { cfg.workspaces_root = root + "/workspaces"; cfg.runtime = "docker"; cfg.idle_seconds = 0; -<<<<<<< HEAD const int64_t tid = 8; const std::string decoy = cfg.workspaces_root + "/t" + @@ -173,17 +172,6 @@ TEST_CASE("sandbox read: O_NOFOLLOW refuses leaf symlink swap after resolve") { REQUIRE(::symlink(outside.c_str(), decoy.c_str()) == 0); swapped = true; }; -======= - // The reader sleeps this long between resolve and the O_NOFOLLOW - // open, giving the planter thread room to swap the leaf for a - // symlink. 80ms was too tight on the loaded macos-arm64 runner: - // std::this_thread::sleep_for has coarse timer granularity there, - // so the planter's pre-swap sleep overshot the reader's open and - // the reader saw the still-regular decoy (ok=true, no leak, but - // CHECK_FALSE(ok) failed). 400ms gives the swap a wide margin to - // land before the open regardless of scheduler jitter. - cfg.read_check_pause_ms = 400; ->>>>>>> origin/main const std::string bin = root + "/bin"; fs::create_directories(bin); @@ -205,25 +193,6 @@ TEST_CASE("sandbox read: O_NOFOLLOW refuses leaf symlink swap after resolve") { std::string werr; REQUIRE(mgr.write_to_workspace(tid, "decoy.txt", "workspace-bytes", werr)); -<<<<<<< HEAD -======= - const std::string decoy = ws + "/decoy.txt"; - - std::atomic swapped{false}; - std::thread planter([&]() { - // A tiny sleep lets the reader's resolve_within_workspace finish - // first (resolve is a handful of syscalls, well under a - // millisecond) so the swap lands *after* resolve and the open - // hits the O_NOFOLLOW refusal path rather than resolve-rejection. - // 5ms is enough to lose resolve but, with read_check_pause_ms - // above, far inside the reader's pre-open window even when the - // macOS timer coarsely oversleeps. - std::this_thread::sleep_for(std::chrono::milliseconds(5)); - ::unlink(decoy.c_str()); - REQUIRE(::symlink(outside.c_str(), decoy.c_str()) == 0); - swapped.store(true); - }); ->>>>>>> origin/main std::string content, mime, err; const bool ok = mgr.read_from_workspace(tid, "decoy.txt", content, mime, err); diff --git a/tests/test_schedule_parser.cpp b/tests/test_schedule_parser.cpp index ddc850b7..90fc8d71 100644 --- a/tests/test_schedule_parser.cpp +++ b/tests/test_schedule_parser.cpp @@ -104,14 +104,14 @@ TEST_CASE("parse: 'on YYYY-MM-DD'") { CHECK(!past.ok); } -<<<<<<< HEAD SUBCASE("year 1 does not persist next_fire_at=-1") { // mktime fails or yields a pre-epoch value; either way we fail // closed instead of storing -1 (which list_due treats as always due). auto r = parse_schedule_phrase("on 0001-01-01 at 09:00", now); CHECK_FALSE(r.ok); CHECK(r.spec.next_fire_at == 0); -======= + } + SUBCASE("rejects calendar-impossible dates instead of overflowing") { // mktime would turn Feb 31 into early March; /schedule must fail closed. auto feb31 = parse_schedule_phrase("on 2027-02-31 at 12:00", now); @@ -130,7 +130,6 @@ TEST_CASE("parse: 'on YYYY-MM-DD'") { CHECK(leap.ok); CHECK(leap.spec.kind == ScheduleSpec::Kind::Once); CHECK(leap.spec.fire_at > now); ->>>>>>> origin/main } }