Skip to content

Commit a873d9c

Browse files
committed
Fix flaky TestDestroyPodInflight test
This fix deletes Route before Configuration to prevent reconciliation errors during teardown (fixes "revision not found" and "failed to fetch loadbalancer" errors in CI logs) The test now correctly validates that in-flight requests complete successfully during graceful shutdown.
1 parent cf48bab commit a873d9c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/e2e/destroypod_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,16 @@ func TestDestroyPodInflight(t *testing.T) {
144144
// Give the request a bit of time to be established and reach the pod.
145145
time.Sleep(timeoutRequestDuration / 2)
146146

147-
t.Log("Destroying the configuration (also destroys the pods)")
148-
return clients.ServingClient.Configs.Delete(egCtx, names.Config, metav1.DeleteOptions{})
147+
t.Log("Destroying the route and configuration (also destroys the pods)")
148+
// Delete the Route first to prevent reconciliation errors during cleanup
149+
if err := clients.ServingClient.Routes.Delete(egCtx, names.Route, metav1.DeleteOptions{}); err != nil {
150+
return fmt.Errorf("failed to delete route: %w", err)
151+
}
152+
// Then delete the Configuration
153+
if err := clients.ServingClient.Configs.Delete(egCtx, names.Config, metav1.DeleteOptions{}); err != nil {
154+
return fmt.Errorf("failed to delete config: %w", err)
155+
}
156+
return nil
149157
})
150158

151159
if err := g.Wait(); err != nil {

0 commit comments

Comments
 (0)