Skip to content

Commit

Permalink
chore: fix formatting Signed-off-by: Anthony Corletti <anthcor@gmail.…
Browse files Browse the repository at this point in the history
…com>
  • Loading branch information
anthonycorletti committed Feb 11, 2025
1 parent 6feef87 commit 7869e8e
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tests/framework/microvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ def kill(self):
backend.kill()
self.disks_vhost_user.clear()

assert "Shutting down VM after intercepting signal" not in self.log_data, (
self.log_data
)
assert (
"Shutting down VM after intercepting signal" not in self.log_data
), self.log_data

try:
if self.firecracker_pid:
Expand Down Expand Up @@ -331,9 +331,9 @@ def kill(self):
f"ps aux | grep {self.jailer.jailer_id}"
)
# make sure firecracker was killed
assert stderr == "" and "firecracker" not in stdout, (
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}"
)
assert (
stderr == "" and "firecracker" not in stdout
), 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}"

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

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

current_call = None

Expand Down Expand Up @@ -561,18 +561,18 @@ def pin_threads(self, first_cpu):
Return next "free" cpu core.
"""
for vcpu, pcpu in enumerate(range(first_cpu, first_cpu + self.vcpus_count)):
assert self.pin_vcpu(vcpu, pcpu), (
f"Failed to pin fc_vcpu {vcpu} thread to core {pcpu}."
)
assert self.pin_vcpu(
vcpu, pcpu
), f"Failed to pin fc_vcpu {vcpu} thread to core {pcpu}."
# The cores first_cpu,...,first_cpu + self.vcpus_count - 1 are assigned to the individual vCPU threads,
# So the remaining two threads (VMM and API) get first_cpu + self.vcpus_count
# and first_cpu + self.vcpus_count + 1
assert self.pin_vmm(first_cpu + self.vcpus_count), (
"Failed to pin firecracker thread."
)
assert self.pin_api(first_cpu + self.vcpus_count + 1), (
"Failed to pin fc_api thread."
)
assert self.pin_vmm(
first_cpu + self.vcpus_count
), "Failed to pin firecracker thread."
assert self.pin_api(
first_cpu + self.vcpus_count + 1
), "Failed to pin fc_api thread."

return first_cpu + self.vcpus_count + 2

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

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

0 comments on commit 7869e8e

Please sign in to comment.