test(trash): count a volume that unmounted after a busy detach as detached (#499)

On macos-15-intel a detach that reported "Resource busy" finished afterwards, so
the retry found no such volume (portability run 40957282805). The loop now checks
os.path.ismount before each attempt.
This commit is contained in:
Vito Sansevero
2026-10-29 14:33:23 -07:00
parent 06562f34b9
commit 4b599cfefd
+2
View File
@@ -78,6 +78,8 @@ def _detach(mount):
return f"this test still held files open under {mount}: {ours}"
deadline = time.monotonic() + DETACH_WAIT_SECONDS
while True:
if not os.path.ismount(mount):
return None # a "busy" detach can still finish after it returns
done = _hdiutil("detach", mount)
if done.returncode == 0:
return None