Commit dc7e68f
authored
fix(registry): adapt delete_subnet_test to non-System subnet deletion (#10713)
## Problem
`//rs/tests/nns:delete_subnet_test` has been failing since
65ad179 (#10683) with:
```
thread 'main' panicked at rs/tests/nns/delete_subnet_test.rs:207:14:
called `Result::unwrap_err()` on an `Ok` value: ()
```
That commit lifted the CloudEngine-only restriction in
`do_delete_subnet`: governance may now delete any non-System subnet, and
System subnet deletion is refused with a new error message. The registry
unit tests were updated, but the system test still asserted the old
behavior. Since the test's universal canister is installed at the
governance canister ID, deleting the Application/VerifiedApplication
subnets now succeeds, making the test's `unwrap_err()` panic.
## Fix
Update the system test to the new semantics:
- Governance successfully deletes the CloudEngine, Application, and
VerifiedApplication subnets.
- Deleting the System (NNS) subnet is refused with `System subnets may
not be deleted`.
- Assert that only the NNS subnet remains, that the routing table
entries of all deleted subnets are gone, and that the nodes of all
deleted subnets are unassigned and wiped.
- Replace the hardcoded registry version `2` with the actual latest
registry version, robust against the additional deletions.
The engine-controller-only path is covered by the PocketIC unit tests in
`rs/registry/canister/tests/delete_subnet.rs` and is not exercisable
from this system test (the UC occupies the governance canister ID).
## Validation
- rustfmt + clippy clean
- `bazel test //rs/tests/nns:delete_subnet_test` passes on farm:
- setup PASSED (69.8s), test PASSED (21.6s), assert_no_metrics_errors
PASSED, assert_no_unallowed_log_patterns PASSED1 parent 26d21ef commit dc7e68f
1 file changed
Lines changed: 53 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| 99 | + | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
100 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
| |||
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
131 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 147 | + | |
| 148 | + | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
158 | 163 | | |
159 | | - | |
| 164 | + | |
160 | 165 | | |
161 | 166 | | |
162 | 167 | | |
163 | | - | |
| 168 | + | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
171 | 189 | | |
172 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
173 | 197 | | |
174 | 198 | | |
175 | 199 | | |
176 | 200 | | |
177 | | - | |
| 201 | + | |
178 | 202 | | |
179 | 203 | | |
180 | 204 | | |
| |||
0 commit comments