server: Fix flaky TestServerPathEncodingIssues tests

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
This commit is contained in:
Anthony Fok 2022-10-04 03:43:05 -06:00 committed by Bjørn Erik Pedersen
parent b002d47953
commit 0addb302ac

View file

@ -25,7 +25,6 @@ import (
"github.com/gohugoio/hugo/config" "github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/htesting"
"golang.org/x/net/context" "golang.org/x/net/context"
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
@ -69,13 +68,6 @@ func TestServer404(t *testing.T) {
} }
func TestServerPathEncodingIssues(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) c := qt.New(t)
// Issue 10287 // Issue 10287
@ -83,6 +75,7 @@ func TestServerPathEncodingIssues(t *testing.T) {
r := runServerTest(c, r := runServerTest(c,
serverTestOptions{ serverTestOptions{
pathsToGet: []string{"hügö/"}, pathsToGet: []string{"hügö/"},
getNumHomes: 1,
}, },
) )
@ -125,6 +118,7 @@ status = 404
serverTestOptions{ serverTestOptions{
config: config, config: config,
pathsToGet: []string{"en/this/does/not/exist", "es/this/does/not/exist"}, pathsToGet: []string{"en/this/does/not/exist", "es/this/does/not/exist"},
getNumHomes: 1,
}, },
) )