Skip to content

test(xnet): exercise silently dropped responses on subnet deletion#10793

Draft
mraszyk wants to merge 4 commits into
masterfrom
mraszyk/xnet-subnet-delete-response-drop
Draft

test(xnet): exercise silently dropped responses on subnet deletion#10793
mraszyk wants to merge 4 commits into
masterfrom
mraszyk/xnet-subnet-delete-response-drop

Conversation

@mraszyk

@mraszyk mraszyk commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The subnet-deletion XNet tests only checked that in-flight requests towards a deleted subnet are rejected. This PR also exercises that in-flight responses towards a deleted subnet are silently dropped (a response can never be turned into a reject).

  • Add a universal-canister op LoopUntilGlobalDataSet that loops on canister_status calls (requesting its own status) until its global data is set to a fixed blob, then replies — used to delay a response until a chosen moment.
  • Extend both the system test (rs/tests/message_routing/xnet/subnet_delete_test.rs) and its StateMachine analogue (rs/state_machine_tests/tests/subnet_delete.rs): the deleted subnet's canister calls two canisters on a surviving subnet whose replies are released so that one response ends up in the stream and the other in the sender's output queue when the subnet is deleted.
  • Verify the drops: the queued response via mr_routed_message_count{type="response",status="canister_not_found"}; the streamed response via the stream being discarded (metric-silent bulk drop).

mraszyk and others added 2 commits July 16, 2026 11:38
The subnet deletion XNet test only exercised that requests towards a
deleted subnet are rejected, not that responses towards it are silently
dropped (a response can never be rejected).

Add a universal-canister op `LoopUntilGlobalDataSet` that loops making a
self `canister_status` inter-canister call until the canister's global
data equals a trigger blob, then replies with a reply blob. This delays a
reply across message boundaries until an external message sets the global
data.

Use it in `subnet_delete_test` so UC (on the deleted subnet C) makes two
fire-and-forget calls to two canisters on the surviving sender subnet S,
whose replies are released at different times:
- one before US's 2 MB requests, so its response is inducted into the
  S->C stream;
- one after the S->C stream is full, so its response stays in the sender's
  output queue.

Both responses must be silently dropped when C is deleted. The queued
response is verified via the
`mr_routed_message_count{type="response",status="canister_not_found"}`
metric; the streamed response is dropped together with the whole stream
(intentionally metric-silent), so it is covered indirectly by the
unallowed-`panicked` log guard plus a post-drop health check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t-delete test

Port the response-dropping extension of the system test
`rs/tests/message_routing/xnet/subnet_delete_test.rs` to its StateMachine
analogue.

UC (on the deleted subnet C) makes two fire-and-forget looping calls (the
new `LoopUntilGlobalDataSet` op) to two canisters on the surviving sender
subnet S; their replies are released at different times so that one response
ends up in the S->C stream and the other stays in the sender's output queue.
After C is deleted both must be silently dropped.

Thanks to direct `ReplicatedState` access, the drops are asserted precisely:
the queued response via
`mr_routed_message_count{type="response",status="canister_not_found"} == 1`,
and the streamed response via S's stream towards C being discarded (the
metric-silent bulk drop). Bump the best-effort call timeout so the
early-created responses survive until C is deleted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the test label Jul 16, 2026
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.

1 participant