File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
staging/src/k8s.io/dynamic-resource-allocation/resourceslice Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ func TestControllerSyncPool(t *testing.T) {
145
145
},
146
146
"remove-pool" : {
147
147
nodeUID : nodeUID ,
148
- syncDelay : ptr .To (time .Duration (0 )),
148
+ syncDelay : ptr .To (time .Duration (0 )), // Ensure that the initial object causes an immediate sync of the pool.
149
149
initialObjects : []runtime.Object {
150
150
MakeResourceSlice ().Name (resourceSlice1 ).UID (resourceSlice1 ).
151
151
NodeOwnerReferences (ownerName , string (nodeUID )).NodeName (ownerName ).
@@ -683,6 +683,11 @@ func TestControllerSyncPool(t *testing.T) {
683
683
// from informer event handler).
684
684
actualState := queue .State ()
685
685
actualState .Later = nil
686
+ // If we let the event handler schedule syncs immediately, then that also races
687
+ // and then Ready cannot be compared either.
688
+ if test .syncDelay != nil && * test .syncDelay == 0 {
689
+ actualState .Ready = nil
690
+ }
686
691
var expectState workqueue.MockState [string ]
687
692
assert .Equal (t , expectState , actualState )
688
693
})
You can’t perform that action at this time.
0 commit comments