Skip to content

Commit da3a714

Browse files
committed
tests: print elapsed time for attacing namespace
This is to make sure how long time needed to find block device. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent bea1cf0 commit da3a714

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/nvme_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,15 @@ def attach_ns(self, ctrl_id, nsid):
430430

431431
# Try to find block device for 5 seconds
432432
device_path = f"{self.ctrl}n{str(nsid)}"
433-
stop_time = time.time() + 5
433+
start_time = time.time()
434+
stop_time = start_time + 5
434435
while time.time() < stop_time:
435436
if os.path.exists(device_path) and stat.S_ISBLK(os.stat(device_path).st_mode):
437+
print(f"##### Found {device_path} in {time.time() - start_time} seconds")
436438
return 0
437439
time.sleep(0.1)
438440

441+
print(f"##### Failed to find {device_path} in {time.time() - start_time} seconds")
439442
return 1
440443

441444
def detach_ns(self, ctrl_id, nsid):

0 commit comments

Comments
 (0)