Bigtable: Create table in list_table test, deadline exceed error fix #8879
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #8479
Bigtable: 'test_bigtable_list_tables' snippet flakes with '504 Deadline Exceeded'.
Issue:
As per my understanding this used to occur intermittently when Google cloud takes longer than expected to create instance or table. So we added cool down time before creating table in an instance.
We used to observe this issue sometimes while working on bigtable issues.
Fix:
This fix is added to avoid creating and deleting table for single test.
Instead, common table can be created and used in tests which require table specific tests, except table creation test.
Fix tested with following approaches:
This issue is not consistent in production i suppose. And I was not able to reproduce even once.
I tried different approach to hit this issue,
after creating 6 instances. But didn’t get ‘deadline exceeded’ error though.
Cool down time (timeout=100) code was avoided to hit the issue, but error didn't occur.
---code---
operation = Config.INSTANCE.create(clusters=[cluster])
#We want to make sure the operation completes.
#operation.result(timeout=100) #this code is commented to reproduce issue.
Config.TABLE = Config.INSTANCE.table(TABLE_ID) Config.TABLE.create()
---/code---