Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[logstream] test polling should use a different context #3066

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/logstream/v2/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,9 @@ func TestNamespaceStream(t *testing.T) {

// We can't assume that the cancel signal doesn't race the pod creation signal, so
// we retry a few times to give some leeway.
if err := wait.PollUntilContextTimeout(ctx, 10*time.Millisecond, time.Second, true, func(ctx context.Context) (bool, error) {
if _, err := podClient.Create(context.Background(), knativePod, metav1.CreateOptions{}); err != nil {
pollCtx := context.Background()
if err := wait.PollUntilContextTimeout(pollCtx, 10*time.Millisecond, time.Second, true, func(ctx context.Context) (bool, error) {
if _, err := podClient.Create(pollCtx, knativePod, metav1.CreateOptions{}); err != nil {
return false, err
}

Expand All @@ -314,7 +315,7 @@ func TestNamespaceStream(t *testing.T) {
return true, nil
case <-logFuncInvoked:
t.Log("Log was still produced, trying again...")
if err := podClient.Delete(context.Background(), knativePod.Name, metav1.DeleteOptions{}); err != nil {
if err := podClient.Delete(pollCtx, knativePod.Name, metav1.DeleteOptions{}); err != nil {
return false, err
}
return false, nil
Expand Down
Loading