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): Add explicit sleep before read time use #9080

Merged
merged 3 commits into from
Dec 11, 2023
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
4 changes: 4 additions & 0 deletions datastore/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,10 @@ func TestIntegration_AggregationQueriesInTransaction(t *testing.T) {
if readTime.IsZero() {
// Use current time as read time if read time is not specified in test case
readTime = time.Now().Truncate(time.Microsecond)

// Read time is truncated to microseconds. If immediately used in NewTransaction call,
// it leads to "read_time cannot be in the future" error
time.Sleep(time.Second)
bhshkh marked this conversation as resolved.
Show resolved Hide resolved
}

tx, err := client.NewTransaction(ctx, []TransactionOption{ReadOnly, WithReadTime(readTime)}...)
Expand Down
Loading