Skip to content

Commit a02cacb

Browse files
committed
[aiconformance]: dump resources on namespace deletion failure
This should show us what resources are blocking namespace deletion.
1 parent 11c2749 commit a02cacb

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

  • tests/e2e/scenarios/ai-conformance/validators

tests/e2e/scenarios/ai-conformance/validators/kube.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (h *ValidatorHarness) TestNamespace() string {
195195

196196
h.t.Cleanup(func() {
197197
ctx := context.WithoutCancel(h.Context())
198-
h.dumpNamespaceResources(ctx, ns)
198+
h.dumpNamespaceResources(ctx, ns, "cluster-info")
199199

200200
startTime := time.Now()
201201

@@ -215,9 +215,10 @@ func (h *ValidatorHarness) TestNamespace() string {
215215
return false, nil
216216
}); err != nil {
217217
h.Errorf("error waiting for namespace deletion: %v", err)
218+
h.dumpNamespaceResources(ctx, ns, "namespace-deletion-failure-info")
219+
} else {
220+
h.Logf("Namespace deletion took %s", time.Since(startTime).Round(time.Second))
218221
}
219-
220-
h.Logf("Namespace deletion took %s", time.Since(startTime).Round(time.Second))
221222
})
222223
}
223224

@@ -243,8 +244,8 @@ func (h *ValidatorHarness) ApplyManifest(defaultNamespace string, manifestPath s
243244
}
244245

245246
// dumpNamespaceResources dumps key resources from the namespace to the artifacts directory for debugging.
246-
func (h *ValidatorHarness) dumpNamespaceResources(ctx context.Context, ns string) {
247-
clusterInfoDir := testartifacts.PathForTestArtifact(h.t, "cluster-info")
247+
func (h *ValidatorHarness) dumpNamespaceResources(ctx context.Context, ns string, outputDir string) {
248+
clusterInfoDir := testartifacts.PathForTestArtifact(h.t, outputDir)
248249
clusterInfoDir = filepath.Join(clusterInfoDir, ns)
249250

250251
if err := os.MkdirAll(clusterInfoDir, 0o755); err != nil {

0 commit comments

Comments
 (0)