Skip to content
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

Fix recovery-spec test to use only the autoloaded assets in the jobSpec #3568

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

busma13
Copy link
Contributor

@busma13 busma13 commented Mar 14, 2024

This PR makes the following changes:

  • export the array of e2e autoloaded assets
  • Use the array of autoloaded assets in TerasliceHarness.getBaseAssetIds() to get the IDs of autoloaded assets
  • Use TerasliceHarness.getBaseAssetIds() in recovery-spec to set the jobSpec.assets array to only the autoloaded assets.

These changes prevent the recovery-spec from trying to use assets placed in the teraslice.assets_directory by other tests running in parallel, that have not finished uploading to ES.
Ref: #3567

@busma13
Copy link
Contributor Author

busma13 commented Mar 15, 2024

This solution works, but I want to look into why we can't just use the array of asset names for jobSpec.assets. The initializeTestExecution calls JobValidator.validateConfig(). The JobValidator uses the OperationLoader which expects asset IDs, not assets names. It seems like jobConfig and ExecutionConfig types might be getting muddled.

@busma13
Copy link
Contributor Author

busma13 commented Mar 21, 2024

I dug into this and here's what I found out:

  • OperationLoader uses the asset name it is given as part of the path to the asset.
  • JobValidator is used exclusively by the JobsService except for when it is used by tests. JobsService._ensureAssets() converts all jobSpec.assets strings to their IDs using spawnAssetLoader, so validation always passes because the assets are in a subdirectory named as the asset ID.
  • recovery-spec is the only test that uses assets from the teraslice.assets_directory. So asset names must be converted to asset IDs so that OperationLoader has the proper path to the assets.
  • Any other assets used in tests are in a directory named as the asset name, so the OperationLoader can use the asset name in the asset path to find the information it is looking for.

I think the changes I have made in the PR solve the problem sufficiently.

@busma13 busma13 force-pushed the separate-assets-shared-state-e2e-tests branch from 1ae8549 to 62f35ed Compare March 21, 2024 21:39
@busma13 busma13 marked this pull request as ready for review March 21, 2024 21:39
@busma13 busma13 requested a review from godber March 21, 2024 22:39
@godber godber merged commit 8c43999 into master Mar 28, 2024
42 checks passed
@godber godber deleted the separate-assets-shared-state-e2e-tests branch March 28, 2024 22:29
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.

2 participants