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(firestore): Fix TestIntegration_BulkWriter_Create #9240

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

bhshkh
Copy link
Contributor

@bhshkh bhshkh commented Jan 9, 2024

Issue: TestIntegration_BulkWriter_Create fails with error:

=== RUN   TestIntegration_BulkWriter_Create
    integration_test.go:2362: "Successful": Mismatch in error got: AlreadyExists, want: "OK"
--- FAIL: TestIntegration_BulkWriter_Create (18.36s)

Cause:
There are 2 test cases in TestIntegration_BulkWriter_Create

Before running the testcases, a Firestore document is created with ID bw_create_(current unix time).
Then, first testcase is executed which creates a document with ID bw_create_(current unix time) and expects the creation to be successful but since there is very little time lapse between the 2 ID creations, they are identical. Thus, the second document creation fails with error AlreadyExists.

Fix:
Use IDs bw_create_1_(current unix time) and bw_create_2_(current unix time)

@bhshkh bhshkh requested review from a team as code owners January 9, 2024 23:14
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Jan 9, 2024
@product-auto-label product-auto-label bot added the api: firestore Issues related to the Firestore API. label Jan 9, 2024
@bhshkh bhshkh linked an issue Jan 9, 2024 that may be closed by this pull request
@bhshkh bhshkh enabled auto-merge (squash) January 10, 2024 20:28
@bhshkh bhshkh merged commit e8dc540 into googleapis:main Jan 10, 2024
9 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the Firestore API. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

firestore: TestIntegration_BulkWriter_Create failed
4 participants