Use valid cellular birth path in publication test
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m56s
Foundation / checks (checks) (push) Failing after 4m12s
Foundation / checks (tsan) (push) Successful in 8m53s
Foundation / checks (postgres) (push) Failing after 32m37s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m56s
Foundation / checks (checks) (push) Failing after 4m12s
Foundation / checks (tsan) (push) Successful in 8m53s
Foundation / checks (postgres) (push) Failing after 32m37s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
This commit is contained in:
@@ -7093,3 +7093,10 @@ on the newly created host; host recovery and lease acquisition happen during
|
|||||||
`step()`. The test now checks readiness first, matching the established restart
|
`step()`. The test now checks readiness first, matching the established restart
|
||||||
test. PostgreSQL CI and Harbor image publication must rerun before a playtest
|
test. PostgreSQL CI and Harbor image publication must rerun before a playtest
|
||||||
image is available.
|
image is available.
|
||||||
|
|
||||||
|
CI run #328 passed that recovery check, then reached a second obsolete fixture
|
||||||
|
that constructed a tick-0 cellular genesis from a primitive life born at tick 1.
|
||||||
|
`CellularLives::create` correctly rejects that impossible chronology. The test
|
||||||
|
now provisions an empty v1 genesis and publishes its first life through the
|
||||||
|
allocator-backed control and birth path, retaining the action publication and
|
||||||
|
restart assertions. PostgreSQL CI and Harbor image publication remain pending.
|
||||||
|
|||||||
@@ -361,22 +361,14 @@ void run_cellular_publication_tests() {
|
|||||||
|
|
||||||
constexpr RegionKey key{9756, 1};
|
constexpr RegionKey key{9756, 1};
|
||||||
|
|
||||||
auto endowed = evo::biology::primitive_endowment();
|
auto primitive = PrimitiveLives::create({key.world, key.region, 1, 17, {}, {{0, 0}}});
|
||||||
CHECK(endowed);
|
|
||||||
auto funding = endowed->body;
|
|
||||||
funding.energy.value = endowed->reserve.energy.value + endowed->construction.value;
|
|
||||||
auto primitive = PrimitiveLives::create({key.world, key.region, 1, 17, funding, {{0, 0}}});
|
|
||||||
CHECK(primitive);
|
CHECK(primitive);
|
||||||
LifeRequest founder;
|
|
||||||
founder.account = filled<16>(0x43);
|
|
||||||
founder.action = 7;
|
|
||||||
CHECK((*primitive)->spawn(founder, {1, 101, 201, 301, {0}}));
|
|
||||||
auto habitat =
|
auto habitat =
|
||||||
evo::biology::CellularHabitat::create({key.world, key.region, 1, 1'000, 1'000, {}});
|
evo::biology::CellularHabitat::create({key.world, key.region, 1, 1'000, 1'000, {}});
|
||||||
CHECK(habitat);
|
CHECK(habitat);
|
||||||
auto opening =
|
auto opening =
|
||||||
CellularLives::create(**primitive, std::move(*habitat), {{1'000, 1'000}, 0, 293'150});
|
CellularLives::create(**primitive, std::move(*habitat), {{1'000, 1'000}, 0, 293'150});
|
||||||
CHECK(opening && (*opening)->lives().size() == 1);
|
CHECK(opening && (*opening)->lives().empty());
|
||||||
|
|
||||||
const auto payload = (*opening)->snapshot();
|
const auto payload = (*opening)->snapshot();
|
||||||
const auto payload_digest = sha256(payload);
|
const auto payload_digest = sha256(payload);
|
||||||
@@ -391,6 +383,9 @@ void run_cellular_publication_tests() {
|
|||||||
CHECK(objects && (*objects)->put(payload));
|
CHECK(objects && (*objects)->put(payload));
|
||||||
CHECK(owner->query("SELECT evolution.provision_region_checkpoint($1::bytea)",
|
CHECK(owner->query("SELECT evolution.provision_region_checkpoint($1::bytea)",
|
||||||
std::array{hex(*genesis_bytes)}, 5s));
|
std::array{hex(*genesis_bytes)}, 5s));
|
||||||
|
CHECK(owner->query("INSERT INTO evolution.life_allocators VALUES(9756,1000) "
|
||||||
|
"ON CONFLICT DO NOTHING",
|
||||||
|
{}, 5s));
|
||||||
const auto connect = [&]() -> std::expected<std::unique_ptr<Postgres>, PgFailure> {
|
const auto connect = [&]() -> std::expected<std::unique_ptr<Postgres>, PgFailure> {
|
||||||
return Postgres::connect({env("PGHOST"),
|
return Postgres::connect({env("PGHOST"),
|
||||||
{},
|
{},
|
||||||
@@ -406,6 +401,17 @@ void run_cellular_publication_tests() {
|
|||||||
CHECK(made_host);
|
CHECK(made_host);
|
||||||
auto host = std::move(*made_host);
|
auto host = std::move(*made_host);
|
||||||
CHECK(host->step().ready);
|
CHECK(host->step().ready);
|
||||||
|
const auto authority = host->authority();
|
||||||
|
CHECK(authority);
|
||||||
|
auto runtime = connect_as(env("EVO_PG_RUNTIME_USER"));
|
||||||
|
const auto account = filled<16>(0x43);
|
||||||
|
const auto control =
|
||||||
|
claim_account_control(*runtime, key, checked_value(authority), account, 1, 1, 20'000ms,
|
||||||
|
5s);
|
||||||
|
CHECK(control);
|
||||||
|
const auto requested = host->create_primitive_life(account, control->generation, 7);
|
||||||
|
CHECK(requested.result == evo::network::PrimitiveLifeResult::pending &&
|
||||||
|
requested.life_identity != 0 && host->queued_births().size() == 1);
|
||||||
const auto committed = host->committed();
|
const auto committed = host->committed();
|
||||||
CHECK(committed);
|
CHECK(committed);
|
||||||
const auto& committed_value = checked_value(committed);
|
const auto& committed_value = checked_value(committed);
|
||||||
@@ -416,12 +422,11 @@ void run_cellular_publication_tests() {
|
|||||||
key.world, key.region, 1, committed_value.head.commit, checked_value(predecessor_digest),
|
key.world, key.region, 1, committed_value.head.commit, checked_value(predecessor_digest),
|
||||||
0, 2};
|
0, 2};
|
||||||
batch.ticks.resize(2);
|
batch.ticks.resize(2);
|
||||||
for (auto& tick : batch.ticks)
|
batch.ticks.front().births.push_back(host->queued_births().front());
|
||||||
tick.lives.push_back({(*opening)->lives()[0].identity.life, {}});
|
|
||||||
const auto replay = replay_cellular_batch(*host->state(), batch);
|
const auto replay = replay_cellular_batch(*host->state(), batch);
|
||||||
CHECK(replay);
|
CHECK(replay);
|
||||||
CellularActionRecord action;
|
CellularActionRecord action;
|
||||||
action.account = founder.account;
|
action.account = account;
|
||||||
action.action_id = 77;
|
action.action_id = 77;
|
||||||
action.input[0] = 1; // Tick 1, neutral movement, no patch target.
|
action.input[0] = 1; // Tick 1, neutral movement, no patch target.
|
||||||
const std::array actions{action};
|
const std::array actions{action};
|
||||||
@@ -440,10 +445,11 @@ void run_cellular_publication_tests() {
|
|||||||
CellularRegionHost::create(config, connect, std::move(*restarted_objects));
|
CellularRegionHost::create(config, connect, std::move(*restarted_objects));
|
||||||
CHECK(made_restarted);
|
CHECK(made_restarted);
|
||||||
auto restarted = std::move(*made_restarted);
|
auto restarted = std::move(*made_restarted);
|
||||||
|
CHECK(restarted->step().ready);
|
||||||
const auto restarted_committed = restarted->committed();
|
const auto restarted_committed = restarted->committed();
|
||||||
CHECK(restarted_committed);
|
CHECK(restarted_committed);
|
||||||
const auto& restarted_committed_value = checked_value(restarted_committed);
|
const auto& restarted_committed_value = checked_value(restarted_committed);
|
||||||
CHECK(restarted->step().ready && restarted->state()->tick() == 2 &&
|
CHECK(restarted->state()->tick() == 2 &&
|
||||||
restarted->state()->snapshot() == (**replay).snapshot() &&
|
restarted->state()->snapshot() == (**replay).snapshot() &&
|
||||||
restarted_committed_value.head.sequence == 1);
|
restarted_committed_value.head.sequence == 1);
|
||||||
restarted->drain();
|
restarted->drain();
|
||||||
|
|||||||
Reference in New Issue
Block a user