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:
@@ -361,22 +361,14 @@ void run_cellular_publication_tests() {
|
||||
|
||||
constexpr RegionKey key{9756, 1};
|
||||
|
||||
auto endowed = evo::biology::primitive_endowment();
|
||||
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}}});
|
||||
auto primitive = PrimitiveLives::create({key.world, key.region, 1, 17, {}, {{0, 0}}});
|
||||
CHECK(primitive);
|
||||
LifeRequest founder;
|
||||
founder.account = filled<16>(0x43);
|
||||
founder.action = 7;
|
||||
CHECK((*primitive)->spawn(founder, {1, 101, 201, 301, {0}}));
|
||||
auto habitat =
|
||||
evo::biology::CellularHabitat::create({key.world, key.region, 1, 1'000, 1'000, {}});
|
||||
CHECK(habitat);
|
||||
auto opening =
|
||||
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_digest = sha256(payload);
|
||||
@@ -391,6 +383,9 @@ void run_cellular_publication_tests() {
|
||||
CHECK(objects && (*objects)->put(payload));
|
||||
CHECK(owner->query("SELECT evolution.provision_region_checkpoint($1::bytea)",
|
||||
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> {
|
||||
return Postgres::connect({env("PGHOST"),
|
||||
{},
|
||||
@@ -406,6 +401,17 @@ void run_cellular_publication_tests() {
|
||||
CHECK(made_host);
|
||||
auto host = std::move(*made_host);
|
||||
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();
|
||||
CHECK(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),
|
||||
0, 2};
|
||||
batch.ticks.resize(2);
|
||||
for (auto& tick : batch.ticks)
|
||||
tick.lives.push_back({(*opening)->lives()[0].identity.life, {}});
|
||||
batch.ticks.front().births.push_back(host->queued_births().front());
|
||||
const auto replay = replay_cellular_batch(*host->state(), batch);
|
||||
CHECK(replay);
|
||||
CellularActionRecord action;
|
||||
action.account = founder.account;
|
||||
action.account = account;
|
||||
action.action_id = 77;
|
||||
action.input[0] = 1; // Tick 1, neutral movement, no patch target.
|
||||
const std::array actions{action};
|
||||
@@ -440,10 +445,11 @@ void run_cellular_publication_tests() {
|
||||
CellularRegionHost::create(config, connect, std::move(*restarted_objects));
|
||||
CHECK(made_restarted);
|
||||
auto restarted = std::move(*made_restarted);
|
||||
CHECK(restarted->step().ready);
|
||||
const auto restarted_committed = restarted->committed();
|
||||
CHECK(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_committed_value.head.sequence == 1);
|
||||
restarted->drain();
|
||||
|
||||
Reference in New Issue
Block a user