Skip to content

Commit

Permalink
Expect merged interruptible node selectors
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Dye <[email protected]>
  • Loading branch information
andrewwdye committed Oct 10, 2023
1 parent 072cda8 commit 6fc00ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ func TestBuildResourceSpark(t *testing.T) {

// Validate
// * Interruptible Toleration and NodeSelector set for Executor but not Driver.
// TODO: confirm expected behavior
// * Validate Default NodeSelector set for Driver but overwritten with Interruptible NodeSelector for Executor.
// * Default Tolerations set for both Driver and Executor.
// * Interruptible/Non-Interruptible NodeSelectorRequirements set for Executor Affinity but not Driver Affinity.
Expand All @@ -584,8 +583,11 @@ func TestBuildResourceSpark(t *testing.T) {
assert.Equal(t, tolDriverDefault.Effect, corev1.TaintEffect("NoSchedule"))

assert.Equal(t, 2, len(sparkApp.Spec.Executor.Tolerations))
assert.Equal(t, 1, len(sparkApp.Spec.Executor.NodeSelector))
assert.Equal(t, interruptibleNodeSelector, sparkApp.Spec.Executor.NodeSelector)
assert.Equal(t, 2, len(sparkApp.Spec.Executor.NodeSelector))
assert.Equal(t, map[string]string{
"x/default": "true",
"x/interruptible": "true",
}, sparkApp.Spec.Executor.NodeSelector)

tolExecInterrupt := sparkApp.Spec.Executor.Tolerations[0]
assert.Equal(t, tolExecInterrupt.Key, "x/flyte")
Expand All @@ -599,8 +601,6 @@ func TestBuildResourceSpark(t *testing.T) {
assert.Equal(t, tolExecDefault.Operator, corev1.TolerationOperator("Equal"))
assert.Equal(t, tolExecDefault.Effect, corev1.TaintEffect("NoSchedule"))

assert.Equal(t, "true", sparkApp.Spec.Executor.NodeSelector["x/interruptible"])

for confKey, confVal := range dummySparkConf {
exists := false

Expand Down

0 comments on commit 6fc00ea

Please sign in to comment.