Fix the flaky upload test
acme/apiOpus 5.5Ready

Fix the flaky upload test. It fails about one run in five.

  1. Command

    bash
    bun test upload --rerun 20

    Result · 41s

    No output
  2. upload.ts

    Input

    json
    {"path":"src/upload.ts"}

    Result · 0.4s

    No output
  3. Input

    json
    {"pattern":"finishUpload"}

    Result · 0.3s

    No output
  4. upload.tsupload.test.ts

    Input

    json
    {"path":"src/upload.ts"}

    Result · 0.9s

    No output

    Input

    json
    {"path":"src/upload.test.ts"}

    Result · 0.7s

    No output
  5. Command

    bash
    bun test upload --rerun 20

    Result · 43s

    No output
Fix the flaky upload test#128Open
  1. Merge into mainready
  2. Wait for the file before finishing the uploadq/flaky-uploadd29f50 Q · 1m
  3. Bump the upload timeoutmain5be27d maria · 7m
Ready to merge·3 checks passedTests412 passed38sTypesLint

Found it: the upload finished before the file was fully written, so the test read a partial file. Uploads now wait for the write to finish. 20 runs, 0 failures.

#128Ready to merge