Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(spanner): fix potential data race in test (#5006)
Fixes a potential data race condition in the test cases that use the TestExporter. The TestExporter keeps all exported spans in a map that should only be accessed while the mutex has been locked. The mutex is however not exported, which makes it impossible for tests to lock it. The test cases therefore now only create one session, and wait for this session to have been created, before it tries to access the exported spans. This prevents a potential race condition where a BatchCreateSession RPC invocation tries to add an element to the map with exported spans, while the test case is reading the map to check which spans have been exported. Fixes #5005
- Loading branch information
Showing
1 changed file
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters