mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Fix leaky goroutine
By making the err chan buffered so both go routines can return. Also make sure that any errors are logged. Fixes #2488
This commit is contained in:
committed by
GitHub
parent
63a6da06d8
commit
a0167d838e
@@ -10,6 +10,7 @@ import (
|
||||
"path/filepath"
|
||||
"text/template"
|
||||
|
||||
"github.com/fortytw2/leaktest"
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
@@ -185,6 +186,7 @@ func TestMultiSitesBuild(t *testing.T) {
|
||||
}
|
||||
|
||||
func doTestMultiSitesBuild(t *testing.T, configTemplate, configSuffix string) {
|
||||
defer leaktest.Check(t)()
|
||||
testCommonResetState()
|
||||
siteConfig := testSiteConfig{DefaultContentLanguage: "fr"}
|
||||
sites := createMultiTestSitesForConfig(t, siteConfig, configTemplate, configSuffix)
|
||||
@@ -347,6 +349,7 @@ func doTestMultiSitesBuild(t *testing.T, configTemplate, configSuffix string) {
|
||||
}
|
||||
|
||||
func TestMultiSitesRebuild(t *testing.T) {
|
||||
defer leaktest.Check(t)()
|
||||
testCommonResetState()
|
||||
siteConfig := testSiteConfig{DefaultContentLanguage: "fr"}
|
||||
sites := createMultiTestSites(t, siteConfig, multiSiteTOMLConfigTemplate)
|
||||
@@ -654,7 +657,6 @@ func TestChangeDefaultLanguage(t *testing.T) {
|
||||
// Default language is now en, so that should now be the "root" language
|
||||
assertFileContent(t, "public/fr/sect/doc1/index.html", true, "Single", "Bonjour")
|
||||
assertFileContent(t, "public/sect/doc2/index.html", true, "Single", "Hello")
|
||||
|
||||
}
|
||||
|
||||
var multiSiteTOMLConfigTemplate = `
|
||||
|
Reference in New Issue
Block a user