@samitouri / QOSami-HFS / commits / f9f5f442

test: mitigated race condition on upload.interrupted

Massimo Melina committed Apr 21, 2025 at 10:51 UTC f9f5f4426f180dab4b9079867898a521659bf2c7
1 file changed +1
tests/test.ts
+1
@@ -203,6 +203,7 @@ describe('after-login', () => {
203 const r = reqUpload(UPLOAD_DEST, 0, makeReadableThatTakes(neededTime))()
204 setTimeout(r.abort, afterMs)
205 return r.catch(() => {}) // wait for it to fail
206 + .then(() => wait(1)) // aborted requests don't guarantee that the server has finished and released the file, so we wait some arbitrary time
207 }
208 const timeFirstRequest = neededTime * .5 // not enough to finish
209 await makeAbortedRequest(timeFirstRequest)