Skip to content

Commit e0c1461

Browse files
committed
Fixed AdminAPI random test failures:
Added missing check_sandbox_has_metadata in setup.py to be available in the Python test scripts Increased the timeout value to 120 in wait_sandbox_in_metadata()
1 parent 9f6fc15 commit e0c1461

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

unittest/scripts/js_devapi/setup/setup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ function check_sandbox_in_metadata(instance_port) {
181181
function wait_sandbox_in_metadata(instance_port) {
182182
var connected = connect_to_sandbox([instance_port]);
183183
if (connected) {
184-
wait(60, 1, check_sandbox_has_metadata);
185-
wait_sandbox(60, 1, check_sandbox_in_metadata, instance_port);
184+
wait(120, 1, check_sandbox_has_metadata);
185+
wait_sandbox(120, 1, check_sandbox_in_metadata, instance_port);
186186
session.close();
187187
}
188188
}

unittest/scripts/py_devapi/setup/setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ def wait_sandbox(timeout, wait_interval, condition, sandbox_port):
157157
res = condition([sandbox_port])
158158
return res
159159

160+
def check_sandbox_has_metadata():
161+
sandbox_has_metadata = session.run_sql("SELECT count(*) FROM information_schema.TABLES WHERE (TABLE_SCHEMA = 'mysql_innodb_cluster_metadata') AND (TABLE_NAME = 'instances')").fetch_one()[0]
162+
163+
print "---> count(*) sandbox has metadata = %s" % sandbox_has_metadata
164+
165+
return sandbox_has_metadata == "1"
166+
160167
def check_sandbox_in_metadata(instance_port):
161168
sandbox_count_metadata = session.run_sql("select count(*) from mysql_innodb_cluster_metadata.instances where instance_name = 'localhost:{0}'".format(instance_port)).fetch_one()[0]
162169

@@ -167,7 +174,8 @@ def check_sandbox_in_metadata(instance_port):
167174
def wait_sandbox_in_metadata(instance_port):
168175
connected = connect_to_sandbox([instance_port]);
169176
if (connected):
170-
wait_sandbox(60, 1, check_sandbox_in_metadata, instance_port)
177+
wait(120, 1, check_sandbox_has_metadata)
178+
wait_sandbox(120, 1, check_sandbox_in_metadata, instance_port)
171179
session.close()
172180

173181
# Smart deployment routines

0 commit comments

Comments
 (0)