diff options
author | Ondrej Holy <oholy@redhat.com> | 2022-03-23 09:46:07 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2022-03-23 10:01:44 +0100 |
commit | 60fe2a553c92a99621990e3db08d0c65e8b81c8d (patch) | |
tree | b634359d9e87e498c0c628b7cd143f50097774f4 | |
parent | e15c63c462b84cf1f598fd8a3744fa7aaa4a8d86 (diff) | |
download | gvfs-wip/oholy/test-timeouts.tar.gz |
test: Add timeoutswip/oholy/test-timeouts
-rwxr-xr-x | test/gvfs-test | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/gvfs-test b/test/gvfs-test index 8beb7266..a3f1855e 100755 --- a/test/gvfs-test +++ b/test/gvfs-test @@ -128,7 +128,11 @@ class GvfsTestCase(unittest.TestCase): prog = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) - (out, err) = prog.communicate() + try: + (out, err) = prog.communicate(timeout=30) + except subprocess.TimeoutExpired: + proc.kill() + return (prog.returncode, out, err) def program_out_err(self, argv): @@ -510,7 +514,7 @@ Subsystem sftp %(sftp_server)s # mount it uri = 'sftp://localhost:22222' - subprocess.check_call(['gio', 'mount', uri]) + subprocess.check_call(['gio', 'mount', uri], timeout=30) self.do_mount_check(uri) |