Support async cacheResults in custom testSequencer #8833
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
PR #8642 makes it so that the
sort
method of atestSequencer
can be async in order to support use cases where you fetch test data from an async endpoint. This PR aims to complement it by adding the possibility to store the cache in an async fashion as well.The entire PR comes down to adding the
await
keyword to thecacheResults
method call.Test plan
I am opening this PR as a draft PR because I want to consult with the community on how I should test this feature.
At first I added more tests to the customTestSequencers.test.ts suite. Those tests are e2e tests that spawn a process which will wait for the async operation to end before exiting, making the async process work eventually, thus making the test useless.
Instead, I thought about adding unit tests but currently there are no tests for customSequencers other than the aforementioned e2e. The unit tests for the test_sequencer.test.js test the default implementation and I think adding tests for a custom one will make a mess of it all.
Where and how should I test this?
Thanks