Skip to content

Commit 7869e8e

Browse files
chore: fix formatting Signed-off-by: Anthony Corletti <[email protected]>
1 parent 6feef87 commit 7869e8e

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

tests/framework/microvm.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ def kill(self):
300300
backend.kill()
301301
self.disks_vhost_user.clear()
302302

303-
assert "Shutting down VM after intercepting signal" not in self.log_data, (
304-
self.log_data
305-
)
303+
assert (
304+
"Shutting down VM after intercepting signal" not in self.log_data
305+
), self.log_data
306306

307307
try:
308308
if self.firecracker_pid:
@@ -331,9 +331,9 @@ def kill(self):
331331
f"ps aux | grep {self.jailer.jailer_id}"
332332
)
333333
# make sure firecracker was killed
334-
assert stderr == "" and "firecracker" not in stdout, (
335-
f"Firecracker reported its pid {self.firecracker_pid}, which was killed, but there still exist processes using the supposedly dead Firecracker's jailer_id: {stdout}"
336-
)
334+
assert (
335+
stderr == "" and "firecracker" not in stdout
336+
), f"Firecracker reported its pid {self.firecracker_pid}, which was killed, but there still exist processes using the supposedly dead Firecracker's jailer_id: {stdout}"
337337

338338
# Mark the microVM as not spawned, so we avoid trying to kill twice.
339339
self._spawned = False
@@ -392,9 +392,9 @@ def _validate_api_response_times(self):
392392
if current_call.url != "/snapshot/create":
393393
exec_time = float(match.group("execution_time")) / 1000.0
394394

395-
assert exec_time <= MAX_API_CALL_DURATION_MS, (
396-
f"{current_call.method} {current_call.url} API call exceeded maximum duration: {exec_time} ms. Body: {current_call.body}"
397-
)
395+
assert (
396+
exec_time <= MAX_API_CALL_DURATION_MS
397+
), f"{current_call.method} {current_call.url} API call exceeded maximum duration: {exec_time} ms. Body: {current_call.body}"
398398

399399
current_call = None
400400

@@ -561,18 +561,18 @@ def pin_threads(self, first_cpu):
561561
Return next "free" cpu core.
562562
"""
563563
for vcpu, pcpu in enumerate(range(first_cpu, first_cpu + self.vcpus_count)):
564-
assert self.pin_vcpu(vcpu, pcpu), (
565-
f"Failed to pin fc_vcpu {vcpu} thread to core {pcpu}."
566-
)
564+
assert self.pin_vcpu(
565+
vcpu, pcpu
566+
), f"Failed to pin fc_vcpu {vcpu} thread to core {pcpu}."
567567
# The cores first_cpu,...,first_cpu + self.vcpus_count - 1 are assigned to the individual vCPU threads,
568568
# So the remaining two threads (VMM and API) get first_cpu + self.vcpus_count
569569
# and first_cpu + self.vcpus_count + 1
570-
assert self.pin_vmm(first_cpu + self.vcpus_count), (
571-
"Failed to pin firecracker thread."
572-
)
573-
assert self.pin_api(first_cpu + self.vcpus_count + 1), (
574-
"Failed to pin fc_api thread."
575-
)
570+
assert self.pin_vmm(
571+
first_cpu + self.vcpus_count
572+
), "Failed to pin firecracker thread."
573+
assert self.pin_api(
574+
first_cpu + self.vcpus_count + 1
575+
), "Failed to pin fc_api thread."
576576

577577
return first_cpu + self.vcpus_count + 2
578578

@@ -684,9 +684,9 @@ def _wait_create(self):
684684
@retry(wait=wait_fixed(0.2), stop=stop_after_attempt(5), reraise=True)
685685
def check_log_message(self, message):
686686
"""Wait until `message` appears in logging output."""
687-
assert message in self.log_data, (
688-
f'Message ("{message}") not found in log data ("{self.log_data}").'
689-
)
687+
assert (
688+
message in self.log_data
689+
), f'Message ("{message}") not found in log data ("{self.log_data}").'
690690

691691
@retry(wait=wait_fixed(0.2), stop=stop_after_attempt(5), reraise=True)
692692
def get_exit_code(self):

0 commit comments

Comments
 (0)