You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix test resource leakage and add timeouts to prevent hangs
Fixed critical test isolation issue where DeploymentTest resources were
being reused by ReplicaSetTest, causing infinite loops and CI timeouts.
Changes:
- ReplicaSetTest: Changed label from 'tier: backend' to 'tier: backend-rs'
to prevent Deployment controller from adopting the ReplicaSet
- DeploymentTest: Added tearDown() method to ensure cleanup of Deployment
and HPA resources after each test, preventing resource leakage
- Both tests: Added 60-second timeouts to all wait loops (scaling, deletion)
to prevent infinite hangs and provide clear error messages
Root cause: DeploymentTest created a Deployment with selector 'tier: backend'
which adopted the ReplicaSet from ReplicaSetTest (also labeled 'tier: backend'),
causing the Deployment controller to scale the ReplicaSet to 0. ReplicaSetTest
then waited indefinitely for 2 replicas that would never appear.
This fix ensures tests are properly isolated and will fail fast with descriptive
errors rather than hanging for 25+ minutes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
0 commit comments