Fix optional access in publication tests
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 1m52s
Foundation / checks (tsan) (push) Successful in 7m58s
Foundation / checks (checks) (push) Successful in 33m52s
Foundation / checks (postgres) (push) Failing after 35m18s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

This commit is contained in:
dingo
2026-10-10 16:53:10 -04:00
parent 94edeba474
commit 2986c87f03
2 changed files with 15 additions and 5 deletions
+5
View File
@@ -5714,3 +5714,8 @@ fallback values while still checking both success/presence states. clang-format
19.1.5, clang-tidy 19.1.5 with warnings-as-errors, GCC 13.2 Release/NDEBUG
compilation with warnings-as-errors, and `git diff --check` pass locally. The
PostgreSQL test binary remains unrun locally; awaiting CI rerun.
Windows clang-tidy 19.1.5 additionally reports `bugprone-exception-escape` on
the pre-existing PostgreSQL connection lambda in this test; this warning was not
present in the reported Linux CI diagnostics. The local tidy run excluded only
that check, so Linux CI remains authoritative for it.
+10 -5
View File
@@ -137,8 +137,10 @@ void primitive_host_fenced_spawn() {
CHECK(made && (*made)->step().ready);
auto runtime = connect_as(env("EVO_PG_RUNTIME_USER"));
const auto account = id<16>(0x73);
auto control =
claim_account_control(*runtime, key, *(*made)->authority(), account, 1, 1, 20000ms, 5s);
const auto host_authority = (*made)->authority();
CHECK(host_authority.has_value());
auto control = claim_account_control(*runtime, key, host_authority.value_or(LeaseGrant{}),
account, 1, 1, 20000ms, 5s);
CHECK(control);
const auto born = (*made)->new_life(account, control->generation, 1, 1);
CHECK(born.kind == PrimitiveHostReplyKind::born && born.published &&
@@ -249,9 +251,12 @@ void run_primitive_publication_tests() {
(*bindings)[0][5] == "1");
const auto durable_outcome =
query_primitive_life(*db, key, *lease, alice, control->generation, 1, 5s);
CHECK(durable_outcome && *durable_outcome && (**durable_outcome).published &&
(**durable_outcome).published->identity == 1 &&
(**durable_outcome).published->commit_sequence == 1);
const auto durable_value =
durable_outcome.value_or(std::nullopt).value_or(PrimitiveLifeOutcome{});
const auto durable_binding = durable_value.published.value_or(PrimitiveLifeBinding{});
CHECK(durable_outcome.has_value() && durable_outcome.value_or(std::nullopt).has_value() &&
durable_value.published.has_value() && durable_binding.identity == 1 &&
durable_binding.commit_sequence == 1);
auto reject = reject_primitive_life(*db, key, *lease, alice, control->generation, 1,
LifeRefusal::cancelled, 5s);
CHECK(!reject && reject.error().kind == LifeReservationError::existing_life);