bevyengine / bevyengine/bevy

Flaky asset processing test due to multiple processing tasks for same path.

Open
#22,001 0 comments 0 reactions 0 assignees View on GitHub
A-Assets C-Testing D-Modest S-Needs-Investigation
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.