Skip to content
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

TestSearchIssues/displays_issues_and_pull_requests_tty fails in 2023 #6259

Closed
bmwiedemann opened this issue Sep 14, 2022 · 1 comment · Fixed by #6299
Closed

TestSearchIssues/displays_issues_and_pull_requests_tty fails in 2023 #6259

bmwiedemann opened this issue Sep 14, 2022 · 1 comment · Fixed by #6299
Labels
bug Something isn't working help wanted Contributions welcome p3 Affects a small number of users or is largely cosmetic

Comments

@bmwiedemann
Copy link

Describe the bug

While working on reproducible builds for openSUSE, I found that our gh-2.14.1 package stops building after 2023-03-04

Steps to reproduce the behavior

on openSUSE (or maybe Debian) do a package build with

osc co openSUSE:Factory/gh && cd $_
osc build --vm-type=kvm --noservice --clean --build-opt=--vm-custom-opt="-rtc base=2023-03-05T00:00:00" standard

Expected vs actual behavior

TestSearchIssues/displays_issues_and_pull_requests_tty fails after 2023-03-04, but tests should continue to work in future.

Logs

When building in 2038, I get

                                Diff:   
                                --- Expected
                                +++ Actual
                                @@ -3,4 +3,4 @@
                                
                                -issue  test/cli   #123  bug      bug, p1  about 1 year ago                     
                                -pr     what/what  #456  fix bug  fix      about 1 year ago                     
                                +issue  test/cli   #123  bug      bug, p1  about 17 years ago
                                +pr     what/what  #456  fix bug  fix      about 17 years ago   

                Test:           TestSearchIssues/displays_issues_and_pull_requests_tty
 FAIL
@bmwiedemann bmwiedemann added the bug Something isn't working label Sep 14, 2022
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Sep 14, 2022
@mislav
Copy link
Member

mislav commented Sep 14, 2022

Thank you for the heads-up!

The problem is that TestSearchIssues uses absolute times in result stubs, but doesn't also stub time.Now()

now := time.Now()

As a result, relative time renderings such as about 1 year ago will keep changing as time goes on, eventually breaking the tests.

@mislav mislav added p3 Affects a small number of users or is largely cosmetic help wanted Contributions welcome and removed needs-triage needs to be reviewed labels Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Contributions welcome p3 Affects a small number of users or is largely cosmetic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants