Skip to content

Commit 7d61a0c

Browse files
committed
fix: test_failing_filter intermittent issue
We intermittently get failures in this test while destroying the microVM object given to us by the fixture. That code checks that the microVM was not killed due to a signal and in this case, it clearly has (that's the intention of the test). The test itself is marking the microVM as killed so the cleanup logic should never reach that check. The only way that kill() fails in this case is when test_microvm.mark_killed() (the last command in this test) is never called, meaning that the test errors out before that. I believe that the only point in the code that can cause the test to exit earlier is this: ``` try: test_microvm.start() except requests.exceptions.ConnectionError: pass ``` We are expecting test_microvm.start() to fail due to seccomp violations, however we are only catching the ConnectionError exception. If any other exception is raised the test will fail pre-maturely without setting test_microvm.mark_killed(). In fact, looking at the backtrace from intermittent failures it looks like the code is actually raising a ConnectionResetError. Change the test to catch any error, rather than just ConnectionError. Signed-off-by: Babis Chalios <[email protected]>
1 parent dcfc4c1 commit 7d61a0c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/integration_tests/security/test_custom_seccomp.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import time
77
from pathlib import Path
88

9-
import requests
10-
119
from framework import utils
1210

1311

@@ -76,9 +74,10 @@ def test_failing_filter(uvm_plain, seccompiler):
7674
test_microvm.basic_config(vcpu_count=1)
7775

7876
# Try to start the VM with error checking off, because it will fail.
77+
# pylint: disable=bare-except
7978
try:
8079
test_microvm.start()
81-
except requests.exceptions.ConnectionError:
80+
except:
8281
pass
8382

8483
# Give time for the process to get killed

0 commit comments

Comments
 (0)