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

Flaky test: TestXSSWikiLastCommitInfo #29355

Closed
silverwind opened this issue Feb 23, 2024 · 1 comment · Fixed by #29366
Closed

Flaky test: TestXSSWikiLastCommitInfo #29355

silverwind opened this issue Feb 23, 2024 · 1 comment · Fixed by #29366
Milestone

Comments

@silverwind
Copy link
Member

silverwind commented Feb 23, 2024

Likely one of the recent changes triggered this.

--- FAIL: TestXSSWikiLastCommitInfo (0.46s)
    testlogger.go:60: 2024/02/23 22:34:04 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user2/repo1.wiki.git/info/refs?service=git-upload-pack for 127.0.0.1:46238, 200 OK in 4.2ms @ repo/githttp.go:532(repo.GetInfoRefs)
    testlogger.go:60: 2024/02/23 22:34:04 ...eb/routing/logger.go:102:func1() [I] router: completed POST /user2/repo1.wiki.git/git-upload-pack for 127.0.0.1:46238, 200 OK in 4.4ms @ repo/githttp.go:492(repo.ServiceUploadPack)
    testlogger.go:60: 2024/02/23 22:34:04 ...eb/routing/logger.go:102:func1() [I] router: completed POST /user2/repo1.wiki.git/git-upload-pack for 127.0.0.1:46238, 200 OK in 12.1ms @ repo/githttp.go:492(repo.ServiceUploadPack)
    testlogger.go:60: 2024/02/23 22:34:04 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user2/repo1.wiki.git/info/refs?service=git-receive-pack for 127.0.0.1:46250, 401 Unauthorized in 1.6ms @ repo/githttp.go:532(repo.GetInfoRefs)
    testlogger.go:60: 2024/02/23 22:34:04 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user2/repo1.wiki.git/info/refs?service=git-receive-pack for 127.0.0.1:46250, 200 OK in 7.3ms @ repo/githttp.go:532(repo.GetInfoRefs)
    testlogger.go:60: 2024/02/23 22:34:04 ...eb/routing/logger.go:102:func1() [I] router: completed POST /user2/repo1.wiki.git/git-receive-pack for 127.0.0.1:46250, 200 OK in 14.3ms @ repo/githttp.go:500(repo.ServiceReceivePack)
    --- FAIL: TestXSSWikiLastCommitInfo/Page_view (0.07s)
        testlogger.go:60: 2024/02/23 22:34:04 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user2/repo1/wiki/Home for test-mock:12345, 200 OK in 20.9ms @ repo/wiki.go:474(repo.Wiki)
        xss_test.go:109: 
              Error Trace:  /home/runner/work/gitea/gitea/tests/integration/xss_test.go:109
              Error:        Not equal: 
                            expected: "Gusted edited this page 0001-01-01 00:00:00 +00:00"
                            actual  : "Gusted <script class=\"evil\">alert('Oh no!');</script> edited this page 2024-01-31 00:00:00 +00:00"
                            
                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1 +1 @@
                            -Gusted edited this page 0001-01-01 00:00:00 +00:00
                            +Gusted <script class="evil">alert('Oh no!');</script> edited this page 2024-01-31 00:00:00 +00:00
              Test:         TestXSSWikiLastCommitInfo/Page_view
    --- FAIL: TestXSSWikiLastCommitInfo/Revision_page (0.07s)
        testlogger.go:60: 2024/02/23 22:34:04 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user2/repo1/wiki/Home?action=_revision for test-mock:12345, 200 OK in 24.3ms @ repo/wiki.go:474(repo.Wiki)
        xss_test.go:121: 
              Error Trace:  /home/runner/work/gitea/gitea/tests/integration/xss_test.go:121
              Error:        Not equal: 
                            expected: "Gusted edited this page 0001-01-01 00:00:00 +00:00"
                            actual  : "Gusted <script class=\"evil\">alert('Oh no!');</script> edited this page 2024-01-31 00:00:00 +00:00"
                            
                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1 +1 @@
                            -Gusted edited this page 0001-01-01 00:00:00 +00:00
                            +Gusted <script class="evil">alert('Oh no!');</script> edited this page 2024-01-31 00:00:00 +00:00
              Test:         TestXSSWikiLastCommitInfo/Revision_page
FAIL
@silverwind silverwind added type/proposal The new feature has not been accepted yet but needs to be discussed first. type/testing and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Feb 23, 2024
@wxiaoguang
Copy link
Contributor

The test is not "flaky", but actually wrong.

-> Fix incorrect tests in 1.21 #29366

@lunny lunny added this to the 1.21.7 milestone Feb 24, 2024
@wxiaoguang wxiaoguang linked a pull request Feb 24, 2024 that will close this issue
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants