зеркало из https://github.com/github/vitess-gh.git
test/utils: Close grpc connections even with --skip-teardown.
We can't skip closing of grpc connections, or else the Python interpreter will never exit.
This commit is contained in:
Родитель
afedc63d9a
Коммит
59cd68f07d
|
@ -41,6 +41,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -115,6 +115,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -67,6 +67,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
logging.debug('Tearing down the servers and setup')
|
||||
|
|
|
@ -122,6 +122,7 @@ def _teardown_shard_2():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -166,6 +166,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
logging.debug('Tearing down the servers and setup')
|
||||
|
|
|
@ -192,15 +192,17 @@ def _add_proc(proc):
|
|||
print >> f, proc.pid, os.path.basename(proc.args[0])
|
||||
|
||||
|
||||
def kill_sub_processes():
|
||||
# FIXME(alainjobart): this part is not really related to sub-processes,
|
||||
# but it's a general clean-up. Maybe a utils.clean_up() might be better,
|
||||
# as all integration tests end up running this anyway.
|
||||
def required_teardown():
|
||||
"""Required cleanup steps that can't be skipped with --skip-teardown."""
|
||||
# We can't skip closing of gRPC connections, because the Python interpreter
|
||||
# won't let us die if any connections are left open.
|
||||
global vtctld_connection
|
||||
if vtctld_connection:
|
||||
vtctld_connection.close()
|
||||
vtctld_connection = None
|
||||
|
||||
|
||||
def kill_sub_processes():
|
||||
for proc in pid_map.values():
|
||||
if proc.pid and proc.returncode is None:
|
||||
proc.kill()
|
||||
|
@ -1153,6 +1155,7 @@ def uint64_to_hex(integer):
|
|||
raise ValueError('Integer out of range: %d' % integer)
|
||||
return '%016X' % integer
|
||||
|
||||
|
||||
def get_shard_name(shard, num_shards):
|
||||
"""Returns an appropriate shard name, as a string.
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ def setUpModule():
|
|||
|
||||
def tearDownModule():
|
||||
logging.debug('in tearDownModule')
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
logging.debug('Tearing down the servers and setup')
|
||||
|
|
|
@ -224,6 +224,7 @@ def setUpModule():
|
|||
|
||||
def tearDownModule():
|
||||
logging.debug('in tearDownModule')
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
logging.debug('Tearing down the servers and setup')
|
||||
|
|
|
@ -123,6 +123,7 @@ def setUpModule():
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
utils.required_teardown()
|
||||
if utils.options.skip_teardown:
|
||||
return
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче