diff options
author | Pavi Vetriselvan <pvselvan@umich.edu> | 2020-05-08 17:26:16 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-11 23:57:37 +0000 |
commit | 4639620984ecf63486a8c3a2534151d9bc619b9a (patch) | |
tree | f4d7b59683f59bc948b71d70e9cdbf0ef2bca267 | |
parent | e1df22cefb30e43dd491591c7926e44d33af4119 (diff) | |
download | mongo-4639620984ecf63486a8c3a2534151d9bc619b9a.tar.gz |
SERVER-48059 backup restore WaitForReplication hook should ignore shutdown errors
-rw-r--r-- | buildscripts/resmokelib/testing/hooks/wait_for_replication.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/buildscripts/resmokelib/testing/hooks/wait_for_replication.py b/buildscripts/resmokelib/testing/hooks/wait_for_replication.py index 8720f9456e6..0cc8e6b309f 100644 --- a/buildscripts/resmokelib/testing/hooks/wait_for_replication.py +++ b/buildscripts/resmokelib/testing/hooks/wait_for_replication.py @@ -22,9 +22,18 @@ class WaitForReplication(interface.Hook): """Run mongo shell to call replSetTest.awaitReplication().""" start_time = time.time() client_conn = self.fixture.get_driver_connection_url() - js_cmds = "conn = '{}'; rst = new ReplSetTest(conn); rst.awaitReplication();".format( - client_conn) - shell_options = {"nodb": "", "eval": js_cmds} + js_cmds = """ + conn = '{}'; + try {{ + rst = new ReplSetTest(conn); + rst.awaitReplication(); + }} catch (e) {{ + if (e.code === ErrorCodes.InterruptedAtShutdown || e.code === ErrorCodes.ShutdownInProgress) {{ + jsTestLog("Ignoring shutdown error: " + tojson(e)); + }} + throw e; + }}""" + shell_options = {"nodb": "", "eval": js_cmds.format(client_conn)} shell_proc = core.programs.mongo_shell_program(self.hook_logger, **shell_options) shell_proc.start() return_code = shell_proc.wait() |