Remove most usages of TestDispatcher in paging-common tests - #523
Closed
veyndan wants to merge 2 commits into
Closed
Remove most usages of TestDispatcher in paging-common tests#523veyndan wants to merge 2 commits into
veyndan wants to merge 2 commits into
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. |
claraf3
self-requested a review
April 19, 2023 17:57
veyndan
force-pushed
the
275416222/rm-TestDispatcher-usages
branch
from
April 20, 2023 21:45
8df39fb to
df63e58
Compare
veyndan
force-pushed
the
275416222/rm-TestDispatcher-usages
branch
from
April 24, 2023 08:30
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
harryzz
pushed a commit
to harryzz/compose-multiplatform-core
that referenced
this pull request
Jul 28, 2026
Removes _all_ usages of `TestDispatcher` in the Paging 3 parts of `paging-common` tests, and _some_ usages of `TestDispatcher` in the Paging 2 parts of `paging-common` tests (`PagedListTest.kt` and `ContiguousPagedListTest.kt` are left). Test: ./gradlew test connectedCheck Bug: 275416222 This is an imported pull request from androidx#523. Resolves JetBrains#523 Github-Pr-Head-Sha: 0cf2b19 GitOrigin-RevId: 5aca127 Change-Id: I8cba2977a9ea040fde43fbf58547ab704a26051c
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