Allow cellular spawn and actions together
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 5s
Foundation / checks (client) (push) Canceled after 2m19s
Foundation / checks (network) (push) Canceled after 1m43s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 5s
Foundation / checks (client) (push) Canceled after 2m19s
Foundation / checks (network) (push) Canceled after 1m43s
This commit is contained in:
@@ -563,6 +563,49 @@ void cellular_v7_action_session(const Files& f) {
|
||||
unsupported->close_reason() == SessionCloseReason::unsupported_version);
|
||||
}
|
||||
|
||||
void cellular_v5_spawn_and_v7_action_share_region_sessions(const Files& f) {
|
||||
struct Actions final : ActionLedger {
|
||||
std::expected<std::optional<ActionOutcome>, ActionLedgerError>
|
||||
find(const AccountId&, std::uint64_t) override {
|
||||
return std::optional<ActionOutcome>{};
|
||||
}
|
||||
std::expected<std::optional<DurableActionRecord>, ActionLedgerError>
|
||||
find_record(const AccountId&, std::uint64_t) override {
|
||||
return std::optional<DurableActionRecord>{};
|
||||
}
|
||||
} actions;
|
||||
FakeLedger control;
|
||||
Harness h{f, 4, 64, &control, [&](server::RegionSessionsConfig& c) {
|
||||
c.actions = &actions;
|
||||
c.accept_cellular_actions = true;
|
||||
c.create_primitive_life = [](const AccountId&, std::uint64_t,
|
||||
std::uint64_t request) {
|
||||
return PrimitiveLifeOutcome{request, PrimitiveLifeResult::born, 901, 5};
|
||||
};
|
||||
c.query_primitive_life = [](const AccountId&, std::uint64_t,
|
||||
std::uint64_t request) {
|
||||
return PrimitiveLifeOutcome{request, PrimitiveLifeResult::pending, 0, 0};
|
||||
};
|
||||
}};
|
||||
auto spawn_client = h.connect(h.issuer.grant(account(0xB5), 1), session_protocol_v5);
|
||||
auto action_client = h.connect(h.issuer.grant(account(0xB7), 1), session_protocol_v7);
|
||||
CHECK(h.settled(*spawn_client) && spawn_client->state() == RegionSessionState::established);
|
||||
CHECK(h.settled(*action_client) && action_client->state() == RegionSessionState::established);
|
||||
|
||||
CHECK(spawn_client->request_primitive_life(44));
|
||||
std::vector<PrimitiveLifeOutcome> birth_outcomes;
|
||||
CHECK(h.until([&] { return !(birth_outcomes = spawn_client->take_primitive_life_outcomes()).empty(); }));
|
||||
CHECK(birth_outcomes.front() == PrimitiveLifeOutcome{44, PrimitiveLifeResult::born, 901, 5});
|
||||
|
||||
CHECK(action_client->send_cellular_action(55, 101, 0, 0));
|
||||
std::vector<ActionReceipt> receipts;
|
||||
CHECK(h.until([&] { return !(receipts = action_client->take_action_receipts()).empty(); }));
|
||||
CHECK(receipts.front().status == AdmitStatus::admitted);
|
||||
const auto carried = h.server->carry(101);
|
||||
CHECK(carried.size() == 1 && carried.front().account == account(0xB7) &&
|
||||
carried.front().kind == ActionKind::cellular);
|
||||
}
|
||||
|
||||
// M10.4: intentions, actions and their distinct answers against a simulated host.
|
||||
void intentions_and_actions(const Files& f) {
|
||||
Harness h{f};
|
||||
@@ -1388,6 +1431,7 @@ int main() try {
|
||||
primitive_v5_session(files);
|
||||
cellular_v6_session(files);
|
||||
cellular_v7_action_session(files);
|
||||
cellular_v5_spawn_and_v7_action_share_region_sessions(files);
|
||||
limits(files);
|
||||
durable_control(files);
|
||||
intentions_and_actions(files);
|
||||
|
||||
Reference in New Issue
Block a user