Skip to content

Add a test to check that we're only launching one load task when loading subassets. #20449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

andriyDev
Copy link
Contributor

@andriyDev andriyDev commented Aug 7, 2025

Objective

Solution

  • Count the number of loads for a root asset that are currently happening. Note this needs to count assets by path and type ID, since you could be loading an asset path multiple times with different types.
  • Don't launch a new load for a root asset if its number of loads is positive.
  • Add some special handling for load_untyped_async to allow it to load even if the number of loads is already positive (since we need the handle, which means awaiting the async task which needs to perform the actual load).

Testing

  • Added a test to check that we only launch one task.
    • This test is brittle. We don't have any way to count how many tasks are currently running, so the best we can do is just hope the tasks finish quickly and stall until they are done.
  • Ran the many_foxes example and it now works correctly!

@andriyDev andriyDev added C-Bug An unexpected or incorrect behavior A-Assets Load files from disk to use for things like images, models, and sounds D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 7, 2025
@andriyDev andriyDev marked this pull request as ready for review August 7, 2025 08:05
@andriyDev andriyDev marked this pull request as draft August 7, 2025 08:09
@andriyDev andriyDev removed the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

many_foxes and other animation examples have stopped working Loading an asset and one of its subassets causes two loads of the same asset to occur.
1 participant