Skip to content

Commit

Permalink
Increase short 10 second timeout in TestFakeComponent (#4101)
Browse files Browse the repository at this point in the history
* Remove duplicated short timeout.

* Log when statewatch starts.

* Lower initial retry interval.
  • Loading branch information
cmacknz authored Jan 18, 2024
1 parent caaf078 commit a79407e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pkg/testing/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ func watchState(ctx context.Context, t *testing.T, c client.Client, timeout time
// get a valid StateWatch connection
var sub client.ClientStateWatch
expBackoff := backoff.NewExponentialBackOff()
expBackoff.InitialInterval = 100 * time.Millisecond
expBackoff.MaxElapsedTime = timeout
expBackoff.MaxInterval = 2 * time.Second
err = backoff.RetryNotify(
Expand All @@ -1060,6 +1061,7 @@ func watchState(ctx context.Context, t *testing.T, c client.Client, timeout time
return
}

t.Logf("%s: StateWatch started", time.Now().UTC().Format(time.RFC3339Nano))
for {
recv, err := sub.Recv()
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions testing/integration/fake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ func TestFakeComponent(t *testing.T) {
err = f.Prepare(ctx, fakeComponent, fakeShipper)
require.NoError(t, err)

ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

err = f.Run(ctx, atesting.State{
Configure: simpleConfig1,
AgentState: atesting.NewClientState(client.Healthy),
Expand Down

0 comments on commit a79407e

Please sign in to comment.