Skip to content

Commit fa57471

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 2929048 + bdccf42 commit fa57471

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/kfto/validating_admission_policy_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,13 @@ func TestValidatingAdmissionPolicy(t *testing.T) {
212212
})
213213
t.Run("PyTorchJob should not be admitted without the 'kueue.x-k8s.io/queue-name' label in a labeled namespace", func(t *testing.T) {
214214
test.Eventually(func() error {
215-
err = createPyTorchJob(test, ns.Name)
216-
test.Expect(err).To(HaveOccurred())
217-
test.Expect(err.Error()).To(ContainSubstring("The label 'kueue.x-k8s.io/queue-name' is either missing or does not have a value set"))
218-
return err
219-
}).WithTimeout(10 * time.Second).WithPolling(500 * time.Millisecond).Should(HaveOccurred())
215+
return createPyTorchJob(test, ns.Name)
216+
}).WithTimeout(10 * time.Second).WithPolling(500 * time.Millisecond).Should(
217+
And(
218+
HaveOccurred(),
219+
MatchError(ContainSubstring("The label 'kueue.x-k8s.io/queue-name' is either missing or does not have a value set")),
220+
),
221+
)
220222
defer test.Client().Kubeflow().KubeflowV1().PyTorchJobs(ns.Name).Delete(test.Ctx(), pyt.Name, metav1.DeleteOptions{})
221223
})
222224
t.Run("PyTorchJob should be admitted with the 'kueue.x-k8s.io/queue-name' label in any other namespace", func(t *testing.T) {

0 commit comments

Comments
 (0)