Skip to content

Hold the upload worker up for sure in the test that a frame waits for its uploads - #332

Merged
LogicalError merged 1 commit into
mainfrom
tachyonui/upload-test-race
Nov 21, 2026
Merged

LogicalError merged 1 commit into
mainfrom
tachyonui/upload-test-race

Conversation

@LogicalError

Copy link
Copy Markdown
Owner

GpuReadbackTest.FrameWaitsForItsUploads failed on the Linux clang CI job for #331, at its setup check that the upload worker is busy. The same code passed on the other jobs, and on the run for main after the merge.

Cause

  • The test queues an 8 MB copy, then a 300 ms sleep through UploadWorker::Then, and checks that the worker is busy.
  • Then runs its job at once, on the calling thread, when the worker is idle.
  • On a fast machine the copy is done before Then is called. The sleep then runs on the test's own thread, the worker is never held up, and the check fails.
  • The library behaves as documented here; only the test's setup was racy.

What changes

  • The hold-up sleeps only when it runs on the worker thread.
  • The test queues the copy and the hold-up again until the worker is busy with them, up to 100 times.

Validation

  • The test passes 20 runs in a row on Windows.
  • Full Debug build: no errors or warnings. gui_gpu_tests passes; this PR changes only that program's test file.

… its uploads

FrameWaitsForItsUploads queued an 8 MB copy, then a 300 ms sleep through
UploadWorker::Then, and asserted the worker was busy. Then runs its job
at once when the worker is idle, so on a fast machine the copy was done
first, the sleep ran on the test's own thread, and the assertion failed
(seen on the Linux clang CI job).

- The hold-up sleeps only when it runs on the worker, and is queued again
  until it does.
@LogicalError
LogicalError merged commit 9c027be into main Nov 21, 2026
8 checks passed
@LogicalError
LogicalError deleted the tachyonui/upload-test-race branch November 21, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant