Guard legacy action test optional access
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m57s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (postgres) (push) Failing after 2m48s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (network) (push) Canceled after 5m34s
Foundation / checks (checks) (push) Canceled after 5m44s
Foundation / checks (tsan) (push) Canceled after 52s

This commit is contained in:
dingo
2026-10-11 03:37:19 -04:00
parent 715b7bcd97
commit 58a5c6615b
2 changed files with 16 additions and 6 deletions
+8 -2
View File
@@ -6706,8 +6706,8 @@ locally and CI is pending on the formatting-only follow-up.
CI run 243 found `-Werror,-Wsign-conversion` in the existing cellular-motion
axis clamp, where mixed signed and unsigned conditional expressions selected
their common unsigned type. The clamp now applies signed deltas in explicit
branches and converts only their nonnegative magnitudes. Full run243 checks are
still in progress; the client job failed at this diagnostic before tests ran.
branches and converts only their nonnegative magnitudes. Run 243 failed its
client build at this diagnostic before tests ran.
During run 244, clang-tidy 19 found an unchecked access to the nested optional
in `ActionLedger::find_record`. The function now moves the inner optional to a
@@ -6720,3 +6720,9 @@ reports two `-Wmissing-field-initializers` errors for legacy probe actions after
`CarriedAction` gained its optional cellular input. Those probe records now set
that input to `std::nullopt` explicitly; run 245 stopped before network tests.
The combined repairs are queued for a new full CI run.
Run 246 compiled the action-ledger changes and found that the legacy-action test
used `CHECK` macros to guard nested `optional::value()` calls. Clang-tidy cannot
prove that macro is a control-flow guard. The test now uses explicit throwing
precondition branches before unwrapping, preserving the same assertions. Run
246's network job stopped at those diagnostics before network tests ran.
+8 -4
View File
@@ -478,10 +478,14 @@ void deferred_actions() {
};
ledger.records.emplace_back(alice, ActionOutcome{9, ActionResult::committed_no_effect, 40, 3});
const auto legacy_record = ledger.find_record(alice, 9);
CHECK(legacy_record && legacy_record->has_value() &&
legacy_record->value().outcome ==
ActionOutcome{9, ActionResult::committed_no_effect, 40, 3} &&
!legacy_record->value().cellular_input);
if (!legacy_record.has_value())
throw std::runtime_error{"legacy action lookup failed"};
const auto& maybe_legacy = legacy_record.value();
if (!maybe_legacy.has_value())
throw std::runtime_error{"legacy action record missing"};
const auto& saved_legacy = maybe_legacy.value();
CHECK(saved_legacy.outcome == ActionOutcome{9, ActionResult::committed_no_effect, 40, 3} &&
!saved_legacy.cellular_input);
CHECK(!admit(1, 9, 101) && !admit(1, 20, 101) && !admit(2, 30, 102));
// In-memory refusals answer at once; a repeat of a waiting action is a duplicate.
CHECK(admit(1, 20, 101) == ActionReceipt{20, AdmitStatus::duplicate, 100, 101});