Skip to content

test: hold the first job so the trash-original busy notice is deterministic - #1952

Merged
KnifeLemon merged 1 commit into
mainfrom
fix/trash-original-test-race
Dec 1, 2026
Merged

KnifeLemon merged 1 commit into
mainfrom
fix/trash-original-test-race

Conversation

@KnifeLemon

Copy link
Copy Markdown
Owner

What

TrashOriginalTests.A_source_another_job_still_has_to_convert_is_kept_until_that_one_is_done now holds the first job until both jobs are queued.

  • FakeConverter gets an optional Gate task that it waits for before converting. Without a gate it behaves as before: same synchronous path, same exceptions.
  • The test gives the engine a TaskCompletionSource as the gate, queues both jobs, then releases the gate.

Why

The test queues the same file on two presets and expects the first job to keep the source, with notice.trash_original_busy, because the second job still needs it. Sometimes the queue's worker finished the first job before the test had queued the second. Then no other job needed the source, the first job sent it to the Trash, and the notice never appeared. This failed CI on #1677.

Jobs run one at a time from the channel. With the gate, the first job can only reach its Trash step once the second job is already waiting in the queue.

How tested

  • dotnet test on Filee.Core.Tests, filtered to TrashOriginalTests and JobQueueTests: 95 passed, 1 skipped.
  • The fixed test on its own, 20 runs in a row: all passed.
  • dotnet format --verify-no-changes on the changed files.

Test-only change, so no CHANGELOG line.

🤖 Generated with Claude Code

…nistic

A_source_another_job_still_has_to_convert_is_kept_until_that_one_is_done
queued the same file twice and expected the first job to keep the source
with notice.trash_original_busy. The worker sometimes finished the first
job before the second was queued, so nothing else needed the source, the
first job trashed it and the notice never came (failed CI on #1677).

FakeConverter gets a Gate task it waits for before converting. The test
holds the first job on it until both jobs are queued, then lets it go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KnifeLemon
KnifeLemon merged commit 72b48cb into main Dec 1, 2026
12 checks passed
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