Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/nvme_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,15 @@ def attach_ns(self, ctrl_id, nsid):

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

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

def detach_ns(self, ctrl_id, nsid):
Expand Down
Loading