diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-10-30 11:15:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-10-30 12:18:29 +0100 |
commit | 729593c842794eaf7127050953a5c2256d332051 (patch) | |
tree | 5281780eca14f38571e00de021e0703a96b7f0d3 /hugolib/hugo_sites_build_errors_test.go | |
parent | e65268f2c2dd5ac54681d3266564901d99ed3ea3 (diff) |
hugolib: Fix deadlock when content building times out
Fixes #5375
Diffstat (limited to 'hugolib/hugo_sites_build_errors_test.go')
-rw-r--r-- | hugolib/hugo_sites_build_errors_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build_errors_test.go b/hugolib/hugo_sites_build_errors_test.go index a5825b35f..3af596d7c 100644 --- a/hugolib/hugo_sites_build_errors_test.go +++ b/hugolib/hugo_sites_build_errors_test.go @@ -313,3 +313,33 @@ Some content. } } } + +// https://github.com/gohugoio/hugo/issues/5375 +func TestSiteBuildTimeout(t *testing.T) { + + b := newTestSitesBuilder(t) + b.WithConfigFile("toml", ` +timeout = 5 +`) + + b.WithTemplatesAdded("_default/single.html", ` +{{ .WordCount }} +`, "shortcodes/c.html", ` +{{ range .Page.Site.RegularPages }} +{{ .WordCount }} +{{ end }} + +`) + + for i := 1; i < 100; i++ { + b.WithContent(fmt.Sprintf("page%d.md", i), `--- +title: "A page" +--- + +{{< c >}}`) + + } + + b.CreateSites().Build(BuildCfg{}) + +} |