Skip to content

Commit 2d8dd18

Browse files
committed
tests: don't use "losetup --find"
It slowed down firecracker-containerd's tests before. Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 22ef221 commit 2d8dd18

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/integration_tests/functional/test_drives.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import os
66
import platform
7-
from subprocess import run, PIPE
7+
from subprocess import run
88

99
import pytest
1010

@@ -92,9 +92,11 @@ def test_rescan_dev(test_microvm_with_ssh, network_config):
9292
size=512
9393
)
9494

95-
losetup = ['losetup', '--find', '--show', fs2.path]
96-
losetup_result = run(losetup, stdout=PIPE, check=True)
97-
loopback_device = losetup_result.stdout.decode('utf-8').rstrip()
95+
# "losetup --find" may slow down tests due to
96+
# https://github.com/firecracker-microvm/firecracker-containerd/issues/141
97+
loopback_device = f'/dev/loop{os.getpid()}'
98+
losetup = ['losetup', loopback_device, fs2.path]
99+
run(losetup, check=True)
98100

99101
try:
100102
response = test_microvm.drive.patch(

0 commit comments

Comments
 (0)