You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding functionality to store assets in an external storage like S3 instead of in Elasticsearch (see: #3563) has surfaced a race condition in e2e tests.
simple-spec saves assets to the teraslice.assets_directory cache.
recovery-spec gets the array of asset IDs needed to create a jobSpec from the list of IDs in the teraslice.assets_directory cache.
Since jest runs the two spec files in parallel, simple-spec can be adding an asset while recovery-spec is reading all the assets in the directory.
The additional time required to save an asset in S3 slows the post('/assets') route enough to make obvious that an asset can be added to the local cache in teraslice.assets_directory, but not yet be stored in Elasticsearch.
If recovery-spec gets an ID that has just been added to the cache, it will add it to jobSpec.assets and then run validation on jobSpec. If the validation check for the presence of the asset happens before it has been saved to ES by simple-spec the test will fail with an error: Failure to get assets, caused by TSError: No assets found for "2909ec5fd38466cf6276cc14ede25096f1f34ee9"
The text was updated successfully, but these errors were encountered:
I decided the best approach was to add a function to the teraslice-harness that returns an array of IDs belonging to the "base assets" that the e2e tests autoload. recover-spec calls this function and assigns the return value to jobSpec.assets, ensuring that job validation only checks the assets that were autoloaded.
…ec (#3568)
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
Adding functionality to store assets in an external storage like S3 instead of in Elasticsearch (see: #3563) has surfaced a race condition in e2e tests.
simple-spec
saves assets to theteraslice.assets_directory
cache.recovery-spec
gets the array of asset IDs needed to create ajobSpec
from the list of IDs in theteraslice.assets_directory
cache.simple-spec
can be adding an asset whilerecovery-spec
is reading all the assets in the directory.teraslice.assets_directory
, but not yet be stored in Elasticsearch.recovery-spec
gets an ID that has just been added to the cache, it will add it tojobSpec.assets
and then run validation onjobSpec
. If the validation check for the presence of the asset happens before it has been saved to ES bysimple-spec
the test will fail with an error:Failure to get assets, caused by TSError: No assets found for "2909ec5fd38466cf6276cc14ede25096f1f34ee9"
The text was updated successfully, but these errors were encountered: