-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Ensure order of search history entries in tests #7670
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, however the same problem might also happen here:
NewPipe/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt
Line 147 in 4a7cfd1
SearchHistoryEntry(OffsetDateTime.now().minusSeconds(7), 2, "AC"), |
Could you fix it also there?
A constant would be great 😄
How would it also happen there? every line has the |
The problem here is that the value can't be controlled by the test. NewPipe/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt Lines 147 to 148 in 4a7cfd1
I'm strongly in favor of implementing a hard-coded/current time independent timestamp like OffsetDateTime.of(LocalDateTime.of(2000, 1, 1, 1, 1), ZoneOffset.UTC) and then use that one for the tests. |
There seems to be something wrong with the test on Emulator API 29:
not sure what's causing that but according to https://stackoverflow.com/questions/17016011/junit-test-times-out-despite-executing-quickly and NewPipe/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt Lines 44 to 53 in 3c21be8
|
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
How fast a tests is executed on a shared CI pipeline is not predictable as the build might be throttled because other builds are running. Therefore adding extremely short timeouts inside the tests - where they can't be changed - is a bad idea. Removed them for now.
The above error now also occurs on other branches, e.g. the dev-Branch. Above error should be fixed with a6515d5. The internal was - for a unknown reason - changed from 10s to 1s inside 7d6688f#diff-52b3c5a209220512cb671827511b090b467afb544abcd94da776e7273072ffc0R24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What is it?
Description of the changes in your PR
Fixes the following issue(s)
Due diligence
❗ squash merge