Skip to content

Commit ceba5f4

Browse files
committed
fix ci test
1 parent 03a883f commit ceba5f4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/RestartPipelineTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,11 @@ private void assertNoOrphanedPods() throws Exception {
337337
.map(KubernetesSlave.class::cast)
338338
.map(KubernetesSlave::getPodName)
339339
.collect(Collectors.toSet());
340+
// Scope to this test's pods only (labels include test/build/branch) so pods from other tests sharing the
341+
// namespace are not mistaken for orphans.
340342
await("no orphaned agent pods")
341343
.atMost(60, TimeUnit.SECONDS)
342-
.until(() -> cloud.connect().pods().withLabel("jenkins", "slave").list().getItems().stream()
344+
.until(() -> cloud.connect().pods().withLabels(getLabels(this, name)).list().getItems().stream()
343345
.map(p -> p.getMetadata().getName())
344346
.allMatch(knownPodNames::contains));
345347
}

0 commit comments

Comments
 (0)