Commit dd4c390
committed
fix(test/cleanup): mock _fleet_has_no_remaining_instances on partial-return tests
EC2Fleet partial path now calls _fleet_has_no_remaining_instances, which
runs _collect_with_next_token in a NextToken loop against a MagicMock
ec2_client. MagicMock.get(...) returns a truthy MagicMock for the
NextToken key, so the loop never terminates — the test hung indefinitely.
SpotFleet partial path has the same defensive call. Its retry-based
variant returns a MagicMock whose .get('ActiveInstances', []) yields an
empty iterator, which falsely flags the fleet as empty and triggers an
unintended launch-template cleanup, failing the assertion.
Patch _fleet_has_no_remaining_instances to return False on both
partial-return tests so the production code skips the new defensive
check and the original partial-return semantic is exercised.1 parent 5f90f71 commit dd4c390
1 file changed
Lines changed: 13 additions & 1 deletion
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
313 | 318 | | |
314 | 319 | | |
315 | 320 | | |
| |||
390 | 395 | | |
391 | 396 | | |
392 | 397 | | |
393 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
394 | 406 | | |
395 | 407 | | |
396 | 408 | | |
| |||
0 commit comments