Sequence cellular birth before first action
Foundation / checks (client) (push) Successful in 6s
Foundation / checks (deploy) (push) Successful in 7s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m59s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 7m29s
Foundation / checks (tsan) (push) Canceled after 7m24s
Foundation / checks (postgres) (push) Canceled after 7m28s

This commit is contained in:
dingo
2026-10-12 05:56:52 -04:00
parent 638754f187
commit 633586e5b2
2 changed files with 38 additions and 8 deletions
+30 -8
View File
@@ -423,21 +423,43 @@ void run_cellular_publication_tests() {
CHECK(predecessor_digest);
batch.header = {
key.world, key.region, 1, committed_value.head.commit, checked_value(predecessor_digest),
0, 2};
batch.ticks.resize(2);
0, 1};
batch.ticks.resize(1);
batch.ticks.front().births.push_back(host->queued_births().front());
const auto replay = replay_cellular_batch(*host->state(), batch);
CHECK(replay);
const auto birth_replay = replay_cellular_batch(*host->state(), batch);
CHECK(birth_replay);
const auto birth_publication = host->publish(batch);
CHECK(birth_publication && birth_publication->committed.head.sequence == 1 &&
birth_publication->committed.head.end_tick == 1 &&
host->state()->snapshot() == (**birth_replay).snapshot());
const auto action_predecessor = host->committed();
CHECK(action_predecessor);
const auto& action_predecessor_value = checked_value(action_predecessor);
const auto action_predecessor_digest = sha256(action_predecessor_value.manifest);
CHECK(action_predecessor_digest);
batch = {};
batch.header = {key.world,
key.region,
1,
action_predecessor_value.head.commit,
checked_value(action_predecessor_digest),
1,
2};
batch.ticks.resize(1);
batch.ticks.front().lives.push_back({requested.life_identity, {}});
CellularActionRecord action;
action.account = account;
action.action_id = 77;
action.input[0] = 1; // Tick 1, neutral movement, no patch target.
action.input[0] = 2; // Tick 2, neutral movement, no patch target.
const std::array actions{action};
const auto replay = replay_cellular_batch(*host->state(), batch);
CHECK(replay);
auto published = host->publish(batch, actions);
CHECK(published && published->committed.head.sequence == 1 &&
CHECK(published && published->committed.head.sequence == 2 &&
published->committed.head.end_tick == 2 &&
host->state()->snapshot() == (**replay).snapshot());
CHECK(host->take_finalized_actions() == std::vector<FinalCellularAction>{{action, 1}});
CHECK(host->take_finalized_actions() == std::vector<FinalCellularAction>{{action, 2}});
host->drain();
host.reset();
@@ -454,6 +476,6 @@ void run_cellular_publication_tests() {
const auto& restarted_committed_value = checked_value(restarted_committed);
CHECK(restarted->state()->tick() == 2 &&
restarted->state()->snapshot() == (**replay).snapshot() &&
restarted_committed_value.head.sequence == 1);
restarted_committed_value.head.sequence == 2);
restarted->drain();
}