Flaky asset processing test due to multiple processing tasks for same path.
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
CI: https://github.com/bevyengine/bevy/actions/runs/19775398295/job/56667076447
The failing test is `processor::tests::only_reprocesses_wrong_hash_on_startup`, with the failure:
```
assertion `left == right` failed
left: 3
right: 2
```
Based on my debugging, I believe the situation is that the `dep_changed` asset queues the initial processing task, but then `source_changed` completes its task and enqueues `dep_changed` to be reprocessed and now we have two tasks for the same asset and somehow that seems to block (see below).
## Repro
```sh
while true; do RUST_LOG=bevy_asset=trace cargo t -p bevy_asset --features=multi_threaded wrong_hash --tests; if [ $? -ne 0 ]; then break; fi; done
```
Note: We don't use the log plugin in bevy_asset tests, so I needed to add `bevy_log` as a dev dependency:
```toml
[dev-dependencies]
bevy_log = { path = "../bevy_log", version = "0.18.0-dev" }
```
And add the `bevy_log::LogPlugin::default()` to `create_app_with_asset_processor`.
Doing all this, I actually get a "ran out of loops" error - this means that the code actually blocks. This might mean there are two bugs, but I think they are related. Unfortunately, adding enough traces seems to prevent the blocking, so I am not sure where it is blocking.
Contributor guide
Research direction
Start with the processor::tests::only_reprocesses_wrong_hash_on_startup test and reproduce it using the provided cargo test loop with multi_threaded enabled. Inspect create_app_with_asset_processor and trace how dep_changed and source_changed tasks are queued. Done means the test passes reliably without duplicate same-path tasks or the reported blocking behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100