Skip to content

Commit 26af650

Browse files
committed
Reduce vtctld webdriver test flakiness.
BUG=34072167
1 parent de772f7 commit 26af650

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/vtctld_web_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ def _get_keyspaces(self):
9494

9595
def _get_keyspace_element(self, keyspace_name):
9696
"""Get a specific keyspace element given a keyspace name."""
97-
return self.driver.find_element_by_id('%s-card' % keyspace_name)
97+
element_id = '%s-card' % keyspace_name
98+
wait = WebDriverWait(self.driver, 5)
99+
wait.until(expected_conditions.visibility_of_element_located(
100+
(By.ID, element_id)))
101+
return self.driver.find_element_by_id(element_id)
98102

99103
def _get_shards(self, keyspace_name):
100104
shard_grid = self.driver.find_element_by_id(
@@ -126,6 +130,9 @@ def _get_tablet_names(self):
126130
[(x.split(' ')[0], x.split(' ')[1][1:-1]) for x in tablet_titles])
127131

128132
def _get_shard_record_keyspace_shard(self):
133+
wait = WebDriverWait(self.driver, 5)
134+
wait.until(expected_conditions.visibility_of_element_located(
135+
(By.ID, 'keyspace-shard')))
129136
return self.driver.find_element_by_id('keyspace-shard').text
130137

131138
def _get_shard_record_master_tablet(self):

0 commit comments

Comments
 (0)