Skip to content

Commit

Permalink
fix(test): Catch correct ConnectionError in test_deflate_on_oom
Browse files Browse the repository at this point in the history
Turns out that `except ConnectionError` catches the `ConnectionError`
from the standard library, while what needs to be caught is the
(different) `ConnectionError` from the `requests` package.

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
  • Loading branch information
roypat committed Feb 26, 2025
1 parent 26bb489 commit ca4e793
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/integration_tests/functional/test_balloon.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from subprocess import TimeoutExpired

import pytest
import requests
from tenacity import retry, stop_after_attempt, wait_fixed

from framework.utils import check_output, get_free_mem_ssh
Expand Down Expand Up @@ -209,7 +210,7 @@ def test_deflate_on_oom(uvm_plain_any, deflate_on_oom):

try:
balloon_size_after = test_microvm.api.balloon_stats.get().json()["actual_mib"]
except ConnectionError:
except requests.exceptions.ConnectionError:
assert (
not deflate_on_oom
), "Guest died even though it should have deflated balloon to alleviate memory pressure"
Expand Down

0 comments on commit ca4e793

Please sign in to comment.