Skip to content

Commit 5c9842c

Browse files
committed
test: eliminate Microvm.expect_kill_by_signal
All tests that formerly set this property now use `mark_killed`. The only other location that set this value was `kill()` itself, to avoid errors when kill() ends up being called twice. However, this is already managed by the `Microvm._killed` attribute, so this guarding is not necessary. Thus, remove the `expect_kill_by_signal`, as it is useless. Signed-off-by: Patrick Roy <[email protected]>
1 parent 97b9de8 commit 5c9842c

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

tests/framework/microvm.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ def __init__(
244244

245245
self._numa_node = numa_node
246246

247-
# Flag checked in destructor to see abnormal signal-induced crashes.
248-
self.expect_kill_by_signal = False
249-
250247
# MMDS content from file
251248
self.metadata_file = None
252249

@@ -285,18 +282,14 @@ def kill(self):
285282
self.disks_vhost_user.clear()
286283

287284
assert (
288-
self.expect_kill_by_signal
289-
or "Shutting down VM after intercepting signal" not in self.log_data
285+
"Shutting down VM after intercepting signal" not in self.log_data
290286
), self.log_data
291287

292288
try:
293289
if self.firecracker_pid:
294290
os.kill(self.firecracker_pid, signal.SIGKILL)
295291

296292
if self.screen_pid:
297-
# Killing screen will send SIGHUP to underlying Firecracker.
298-
# Needed to avoid false positives in case kill() is called again.
299-
self.expect_kill_by_signal = True
300293
os.kill(self.screen_pid, signal.SIGKILL)
301294
except:
302295
LOG.error(self.log_data)

0 commit comments

Comments
 (0)