Commit 147908e
authored
chore(bigtable): fix flaky sharded query concurrency limit test by relaxing eps (#17541)
**Flaky tests**:
- The test `test_read_rows_sharded_concurrency_limit` was flaky under VM
execution load because it checked if all of the first 10 concurrent
requests were dispatched within `eps = 0.01` seconds (10 milliseconds)
of the operation's start.
Due to CPU scheduling and thread context switching overhead on
virtualized CI hosts (like Kokoro), dispatching 10 concurrent
threads/tasks can occasionally take slightly longer than 10ms,
triggering random `AssertionError` failures.
**Solution**:
- Relaxed the threshold `eps` from `0.01` to `0.2` seconds (200
milliseconds) in:
- The async source test file:
[tests/unit/data/_async/test_client.py](file:///usr/local/google/home/omairn/git/googleapis/google-cloud-python/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py)
- The sync auto-generated test file:
[tests/unit/data/_sync_autogen/test_client.py](file:///usr/local/google/home/omairn/git/googleapis/google-cloud-python/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py)
This allows enough scheduling margin for virtualized CI runners to pass
successfully while still validating that the first 10 queries are fired
concurrently without delay compared to the queued queries.1 parent 586c7f7 commit 147908e
2 files changed
Lines changed: 2 additions & 2 deletions
File tree
- packages/google-cloud-bigtable/tests/unit/data
- _async
- _sync_autogen
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2328 | 2328 | | |
2329 | 2329 | | |
2330 | 2330 | | |
2331 | | - | |
| 2331 | + | |
2332 | 2332 | | |
2333 | 2333 | | |
2334 | 2334 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1926 | 1926 | | |
1927 | 1927 | | |
1928 | 1928 | | |
1929 | | - | |
| 1929 | + | |
1930 | 1930 | | |
1931 | 1931 | | |
1932 | 1932 | | |
| |||
0 commit comments