Commit 4bb157c
authored
chore: handled race condition in stateless query integration test (#4045)
* fix: handled race condition in stateless query integration test
The testTableResultJobIdAndQueryId test was failing intermittently on slower networks. The test strictly asserted that Job ID must be null for stateless queries.
However, the library correctly falls back to creating a Job ID if the stateless query times out. This change updates the assertion logic to accept either a valid Query ID (stateless success) or a valid Job ID (fallback success).
Fixes #4008
* refactor: use XOR assertion for conciseness
Applied feedback from code review to use exclusive OR operator for validating JobID/QueryID mutual exclusivity.
* fix: apply race condition logic to testStatelessQueries
Applied XOR assertion logic to testStatelessQueries. Test was failing on slow networks because they did not account for JOB_CREATION_OPTIONAL falling back to job creation.
Fixes #4002
* docs: add comment explaining stateless query fallback behavior
* docs: add comment explaining stateless query fallback behavior in testTableResultJobIdAndQueryId()1 parent d214d10 commit 4bb157c
File tree
1 file changed
+14
-4
lines changed- google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it
1 file changed
+14
-4
lines changedLines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7181 | 7181 | | |
7182 | 7182 | | |
7183 | 7183 | | |
7184 | | - | |
7185 | | - | |
| 7184 | + | |
| 7185 | + | |
| 7186 | + | |
| 7187 | + | |
| 7188 | + | |
| 7189 | + | |
7186 | 7190 | | |
7187 | 7191 | | |
7188 | 7192 | | |
| |||
7220 | 7224 | | |
7221 | 7225 | | |
7222 | 7226 | | |
7223 | | - | |
7224 | | - | |
| 7227 | + | |
| 7228 | + | |
| 7229 | + | |
| 7230 | + | |
| 7231 | + | |
| 7232 | + | |
| 7233 | + | |
| 7234 | + | |
7225 | 7235 | | |
7226 | 7236 | | |
7227 | 7237 | | |
| |||
0 commit comments