Skip to content

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

@andriyDev

Description

@andriyDev

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

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:

[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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsC-TestingA change that impacts how we test Bevy or how users test their appsD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions