Skip to content

test: xnet from/to deleted cloud engine#10566

Draft
mraszyk wants to merge 22 commits into
masterfrom
mraszyk/cloud_engine_subnet_delete_test
Draft

test: xnet from/to deleted cloud engine#10566
mraszyk wants to merge 22 commits into
masterfrom
mraszyk/cloud_engine_subnet_delete_test

Conversation

@mraszyk

@mraszyk mraszyk commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the test label Jun 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds coverage for CloudEngine subnet deletion behavior when there are in-flight XNet messages, ensuring messages are rejected appropriately and that remaining stream data from the deleted subnet is not pulled.

Changes:

  • Introduces a new XNet system test binary that deletes a CloudEngine subnet while messages are in flight and asserts expected reject codes.
  • Adds a StateMachine-based analogue test that simulates the same scenario with a shared registry and mocked XNet layer.
  • Wires the new tests into Cargo and Bazel build/test targets.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
rs/tests/message_routing/xnet/cloud_engine_subnet_delete_test.rs New system test for CloudEngine subnet deletion with in-flight XNet messages.
rs/tests/message_routing/xnet/Cargo.toml Adds dependencies and registers the new system test binary.
rs/tests/message_routing/xnet/BUILD.bazel Adds Bazel system_test target for the new test binary and adjusts runtime deps.
rs/state_machine_tests/tests/mod.rs Registers the new state machine test module.
rs/state_machine_tests/tests/cloud_engine_subnet_delete.rs New StateMachine-based test exercising subnet deletion behavior.
rs/state_machine_tests/BUILD.bazel Includes the new state machine test source in the integration test target.
Cargo.lock Lockfile updates for the new/adjusted dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rs/tests/message_routing/xnet/cloud_engine_subnet_delete_test.rs
Comment thread rs/state_machine_tests/tests/subnet_delete.rs
Comment thread rs/tests/message_routing/xnet/cloud_engine_subnet_delete_test.rs Outdated
Comment thread rs/tests/message_routing/xnet/Cargo.toml
Comment thread rs/tests/message_routing/xnet/BUILD.bazel
mraszyk and others added 19 commits June 28, 2026 18:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…t type

Rename cloud_engine_subnet_delete_test to subnet_delete_test and run the
in-flight-XNet-message scenario as a matrix over the deleted subnet's type
(CloudEngine and Application), verifying subnet deletion behaves the same
regardless of subnet type.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lift the CloudEngine-only restriction in do_delete_subnet now that the
deterministic state machine handles deletion of any remote subnet (synthetic
reject responses for outstanding callbacks and dropping of the stream to the
deleted subnet, landed in #10467).

Authorization by subnet type (the caller is already restricted to governance or
the engine controller at the endpoint):
- System subnets (e.g. the NNS) may never be deleted.
- The engine controller may only delete CloudEngine subnets.
- Governance may delete any non-System subnet.

The caller is threaded into do_delete_subnet (mirroring do_update_subnet) to
enforce the engine-controller restriction. Adds registry tests covering
governance deleting an Application subnet, the engine controller being refused,
and System subnets remaining undeletable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts:
#	rs/registry/canister/src/mutations/do_delete_subnet.rs
#	rs/registry/canister/tests/delete_subnet.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants