Remove most usages of TestDispatcher in paging-common tests#523
Closed
veyndan wants to merge 2 commits intoandroidx:androidx-mainfrom
Closed
Remove most usages of TestDispatcher in paging-common tests#523veyndan wants to merge 2 commits intoandroidx:androidx-mainfrom
veyndan wants to merge 2 commits intoandroidx:androidx-mainfrom
Conversation
veyndan
commented
Apr 19, 2023
| // using advanceTimeBy instead of advanceUntilIdle, otherwise this invalid APPEND + subsequent | ||
| // REFRESH will auto run consecutively and we won't be able to assert them incrementally | ||
| loadDispatcher.queue.poll()?.run() | ||
| loadDispatcher.scheduler.advanceTimeBy(1001) |
Contributor
Author
There was a problem hiding this comment.
The default loadDelay of TestPagingSource is 1000ms. We want to advance the first one only, so any value between [1001, 1999] would be valid.
Member
|
The presubmit fails on paging-compose is our issue (as with your other PRs). Don't worry about it. |
8df39fb to
df63e58
Compare
df63e58 to
9b82469
Compare
claraf3
reviewed
Apr 24, 2023
| initialKey = initialKey, | ||
| pagingSourceFactory = { | ||
| TestPagingSource( | ||
| loadDelay = 0, |
Member
There was a problem hiding this comment.
If our tests are relying on a specific loadDelay, might be more reliable to declare a specific loadDelay so its not flaky to default impl changes. Perhaps set delay to 1000 here as well?
Contributor
Author
There was a problem hiding this comment.
Makes sense. Updated PR to explicitly set loadDelay = 1000.
claraf3
approved these changes
Apr 25, 2023
ianhanniballake
approved these changes
Apr 26, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removes all usages of
TestDispatcherin the Paging 3 parts ofpaging-commontests, and some usages ofTestDispatcherin the Paging 2 parts ofpaging-commontests (PagedListTest.ktandContiguousPagedListTest.ktare left).Test: ./gradlew test connectedCheck
Bug: 275416222