Use PollUntilContextTimeout in flowcontrol

Signed-off-by: Omer Aplatony <omerap12@gmail.com>
This commit is contained in:
Omer Aplatony 2024-10-08 10:25:15 +03:00
parent 0b91def6bc
commit 9fe3f368b1
3 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ func TestQueueWaitTimeLatencyTracker(t *testing.T) {
}()
// ensure that the controller has run its first loop.
err := wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (done bool, err error) {
err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
return controller.hasPriorityLevelState(plcObj.Name), nil
})
if err != nil {

View File

@ -165,7 +165,7 @@ func TestBorrowing(t *testing.T) {
}()
// ensure that the controller has run its first loop.
err := wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (done bool, err error) {
err := wait.PollUntilContextTimeout(ctx, 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
return controller.hasPriorityLevelState(plcObjs[0].Name), nil
})
if err != nil {

View File

@ -407,7 +407,7 @@ func TestAPFControllerWithGracefulShutdown(t *testing.T) {
}()
// ensure that the controller has run its first loop.
err := wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (done bool, err error) {
err := wait.PollUntilContextTimeout(ctx, 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
return controller.hasPriorityLevelState(plName), nil
})
if err != nil {