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

test(datastore): Retry aggregation query testcase on failure #8487

Merged
merged 8 commits into from
Aug 29, 2023

Conversation

bhshkh
Copy link
Contributor

@bhshkh bhshkh commented Aug 24, 2023

Issue: Kokoro build fails with error

integration_test.go:886: "Aggregations in transaction after creating entities": Mismatch in aggregation result got: map[avg:null_value:NULL_VALUE count:integer_value:0 sum:integer_value:0], want: map[avg:double_value:3.5 count:integer_value:8 sum:integer_value:28]

Cause: Entities are read too soon after creating and thus are not reflected in the aggregation results.
Fix: Add explicit sleep before running aggregation queries

@bhshkh bhshkh requested review from a team as code owners August 24, 2023 23:48
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Aug 24, 2023
@bhshkh bhshkh added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 24, 2023
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. and removed size: s Pull request size is small. labels Aug 26, 2023
@bhshkh bhshkh changed the title Fix/issue 8466 test(datastore): Add explicit sleep before querying entities Aug 26, 2023
@bhshkh bhshkh linked an issue Aug 26, 2023 that may be closed by this pull request
@bhshkh bhshkh requested review from kolea2 and enocom August 26, 2023 02:51
@bhshkh bhshkh removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 26, 2023
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Aug 28, 2023
@bhshkh bhshkh changed the title test(datastore): Add explicit sleep before querying entities test(datastore): Retry aggregation query testcase on failure Aug 28, 2023
@bhshkh bhshkh requested a review from enocom August 28, 2023 20:49
Copy link
Contributor

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm after nit

@@ -874,18 +874,20 @@ func TestIntegration_AggregationQueries(t *testing.T) {
}

for _, testCase := range testCases {
gotAggResult, gotErr := client.RunAggregationQuery(ctx, testCase.aggQuery)
gotFailure := gotErr != nil
testutil.Retry(t, 10, time.Second, func(r *testutil.R) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a quick comment why we're adding a retry here?

@bhshkh bhshkh enabled auto-merge (squash) August 29, 2023 16:44
@bhshkh bhshkh merged commit b5000f6 into googleapis:main Aug 29, 2023
@bhshkh bhshkh deleted the fix/issue-8466 branch September 11, 2023 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datastore: TestIntegration_AggregationQueries failed
3 participants