Skip to content

Commit

Permalink
test(block-perf): Do not load baselines into global constant
Browse files Browse the repository at this point in the history
this caused pytest to crash during test collection if running on an
unsupported kernel version.

Fixes firecracker-microvm#3726

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
  • Loading branch information
roypat authored and ShadowCurse committed Jul 26, 2023
1 parent ed07d9b commit dc6869f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/integration_tests/performance/test_block_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
TEST_ID = "block_performance"
kernel_version = get_kernel_version(level=1)
CONFIG_NAME_REL = "test_{}_config_{}.json".format(TEST_ID, kernel_version)
CONFIG_NAME_ABS = os.path.join(defs.CFG_LOCATION, CONFIG_NAME_REL)
CONFIG = json.load(open(CONFIG_NAME_ABS, encoding="utf-8"))
CONFIG_NAME_ABS = defs.CFG_LOCATION / CONFIG_NAME_REL

FIO = "fio"

Expand Down Expand Up @@ -298,9 +297,13 @@ def test_block_performance(
"bs": fio_block_size,
},
)

raw_baselines = json.loads(CONFIG_NAME_ABS.read_text("utf-8"))

st_cons = st.consumer.LambdaConsumer(
metadata_provider=DictMetadataProvider(
CONFIG["measurements"], BlockBaselinesProvider(env_id, fio_id)
raw_baselines["measurements"],
BlockBaselinesProvider(env_id, fio_id, raw_baselines),
),
func=consume_fio_output,
func_kwargs={
Expand Down

0 comments on commit dc6869f

Please sign in to comment.