]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
server: Fix flaky TestServerPathEncodingIssues tests
authorAnthony Fok <foka@debian.org>
Tue, 4 Oct 2022 09:43:05 +0000 (03:43 -0600)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 4 Oct 2022 12:48:29 +0000 (14:48 +0200)
Set getNumHomes: 1 to enable 567 ms or 2 s of wait for the server
to be ready in TestServerPathEncodingIssues/Unicode_paths and
TestServerPathEncodingIssues/Windows_multilingual_404.

Fixes #10332

commands/server_test.go

index a02eb3c8bbc979a7bb7741378d7545cb774a6a7d..7a39723733f9b0536cd672452c9b322c10c1c7f4 100644 (file)
@@ -25,7 +25,6 @@ import (
 
        "github.com/gohugoio/hugo/config"
        "github.com/gohugoio/hugo/helpers"
-       "github.com/gohugoio/hugo/htesting"
        "golang.org/x/net/context"
        "golang.org/x/sync/errgroup"
 
@@ -69,20 +68,14 @@ func TestServer404(t *testing.T) {
 }
 
 func TestServerPathEncodingIssues(t *testing.T) {
-       if htesting.IsGitHubAction() {
-               // This test is flaky on CI for some reason. Run it on Windows only for now.
-               // TODO(bep)
-               if runtime.GOOS != "windows" {
-                       t.Skip("Skipping test on CI")
-               }
-       }
        c := qt.New(t)
 
        // Issue 10287
        c.Run("Unicode paths", func(c *qt.C) {
                r := runServerTest(c,
                        serverTestOptions{
-                               pathsToGet: []string{"hügö/"},
+                               pathsToGet:  []string{"hügö/"},
+                               getNumHomes: 1,
                        },
                )
 
@@ -123,8 +116,9 @@ status = 404
 `
                r := runServerTest(c,
                        serverTestOptions{
-                               config:     config,
-                               pathsToGet: []string{"en/this/does/not/exist", "es/this/does/not/exist"},
+                               config:      config,
+                               pathsToGet:  []string{"en/this/does/not/exist", "es/this/does/not/exist"},
+                               getNumHomes: 1,
                        },
                )