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

chore: add to timeouts for query operations in integration tests #8896

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func TestServer_ExecutionTarget(t *testing.T) {
require.NoError(t, err)
defer close()
}
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, time.Minute)
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, 2*time.Minute)
require.EventuallyWithT(t, func(ttt *assert.CollectT) {
got, err := instance.Client.ActionV3Alpha.GetTarget(tt.ctx, tt.req)
if tt.wantErr {
Expand All @@ -276,7 +276,7 @@ func TestServer_ExecutionTarget(t *testing.T) {
func waitForExecutionOnCondition(ctx context.Context, t *testing.T, instance *integration.Instance, condition *action.Condition, targets []*action.ExecutionTargetType) {
instance.SetExecution(ctx, t, condition, targets)

retryDuration, tick := integration.WaitForAndTickWithMaxDuration(ctx, time.Minute)
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(ctx, 2*time.Minute)
require.EventuallyWithT(t, func(ttt *assert.CollectT) {
got, err := instance.Client.ActionV3Alpha.SearchExecutions(ctx, &action.SearchExecutionsRequest{
Filters: []*action.ExecutionSearchFilter{
Expand Down Expand Up @@ -305,7 +305,7 @@ func waitForExecutionOnCondition(ctx context.Context, t *testing.T, instance *in
func waitForTarget(ctx context.Context, t *testing.T, instance *integration.Instance, endpoint string, ty domain.TargetType, interrupt bool) *action.CreateTargetResponse {
resp := instance.CreateTarget(ctx, t, "", endpoint, ty, interrupt)

retryDuration, tick := integration.WaitForAndTickWithMaxDuration(ctx, time.Minute)
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(ctx, 2*time.Minute)
require.EventuallyWithT(t, func(ttt *assert.CollectT) {
got, err := instance.Client.ActionV3Alpha.SearchTargets(ctx, &action.SearchTargetsRequest{
Filters: []*action.TargetSearchFilter{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ func TestServer_ListTargets(t *testing.T) {
require.NoError(t, err)
}

retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, time.Minute)
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, 2*time.Minute)
require.EventuallyWithT(t, func(ttt *assert.CollectT) {
got, listErr := instance.Client.ActionV3Alpha.SearchTargets(tt.args.ctx, tt.args.req)
if tt.wantErr {
Expand Down Expand Up @@ -865,7 +865,7 @@ func TestServer_SearchExecutions(t *testing.T) {
require.NoError(t, err)
}

retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, time.Minute)
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, 2*time.Minute)
require.EventuallyWithT(t, func(ttt *assert.CollectT) {
got, listErr := instance.Client.ActionV3Alpha.SearchExecutions(tt.args.ctx, tt.args.req)
if tt.wantErr {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func TestServer_ListUserSchemas(t *testing.T) {
require.NoError(t, err)
}

retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, time.Minute)
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, 2*time.Minute)
require.EventuallyWithT(t, func(ttt *assert.CollectT) {
got, err := instance.Client.UserSchemaV3.SearchUserSchemas(tt.args.ctx, tt.args.req)
if tt.wantErr {
Expand Down Expand Up @@ -296,7 +296,7 @@ func TestServer_GetUserSchema(t *testing.T) {
require.NoError(t, err)
}

retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, time.Minute)
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(isolatedIAMOwnerCTX, 2*time.Minute)
require.EventuallyWithT(t, func(ttt *assert.CollectT) {
got, err := instance.Client.UserSchemaV3.GetUserSchema(tt.args.ctx, tt.args.req)
if tt.wantErr {
Expand Down
6 changes: 3 additions & 3 deletions internal/integration/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
if wantDetails.GetChangeDate() != nil {
wantChangeDate := time.Now()
gotChangeDate := gotDetails.GetChangeDate().AsTime()
assert.WithinRange(t, gotChangeDate, wantChangeDate.Add(-time.Minute), wantChangeDate.Add(time.Minute))
assert.WithinRange(t, gotChangeDate, wantChangeDate.Add(-10*time.Minute), wantChangeDate.Add(time.Minute))
}

assert.Equal(t, wantDetails.GetResourceOwner(), gotDetails.GetResourceOwner())
Expand All @@ -73,12 +73,12 @@
if expected.GetChanged() != nil {
wantChangeDate := time.Now()
gotChangeDate := actual.GetChanged().AsTime()
assert.WithinRange(t, gotChangeDate, wantChangeDate.Add(-time.Minute), wantChangeDate.Add(time.Minute))
assert.WithinRange(t, gotChangeDate, wantChangeDate.Add(-10*time.Minute), wantChangeDate.Add(time.Minute))

Check warning on line 76 in internal/integration/assert.go

View check run for this annotation

Codecov / codecov/patch

internal/integration/assert.go#L76

Added line #L76 was not covered by tests
}
if expected.GetCreated() != nil {
wantCreatedDate := time.Now()
gotCreatedDate := actual.GetCreated().AsTime()
assert.WithinRange(t, gotCreatedDate, wantCreatedDate.Add(-time.Minute), wantCreatedDate.Add(time.Minute))
assert.WithinRange(t, gotCreatedDate, wantCreatedDate.Add(-10*time.Minute), wantCreatedDate.Add(time.Minute))

Check warning on line 81 in internal/integration/assert.go

View check run for this annotation

Codecov / codecov/patch

internal/integration/assert.go#L81

Added line #L81 was not covered by tests
}
if expected.GetOwner() != nil {
expectedOwner := expected.GetOwner()
Expand Down
Loading