hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 5103935ae80536fbe0624c408016cdcbd1f03c1d
parent 95386544e858949a2baa414f395f30aaf66a6257
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Tue, 13 Jun 2017 21:22:47 +0200

hugolib: Disable shaky leaktest on CI

Diffstat:
Mhugolib/hugo_sites_build_test.go | 6++++--
Mhugolib/testhelpers_test.go | 4++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/hugolib/hugo_sites_build_test.go b/hugolib/hugo_sites_build_test.go
@@ -392,8 +392,10 @@ func doTestMultiSitesBuild(t *testing.T, configTemplate, configSuffix string) {
 
 func TestMultiSitesRebuild(t *testing.T) {
 	// t.Parallel() not supported, see https://github.com/fortytw2/leaktest/issues/4
-	defer leaktest.CheckTimeout(t, 30*time.Second)()
-
+	// This leaktest seems to be a little bit shaky on Travis.
+	if !isCI() {
+		defer leaktest.CheckTimeout(t, 30*time.Second)()
+	}
 	siteConfig := testSiteConfig{Fs: afero.NewMemMapFs(), DefaultContentLanguage: "fr", DefaultContentLanguageInSubdir: true}
 	sites := createMultiTestSites(t, siteConfig, multiSiteTOMLConfigTemplate)
 	fs := sites.Fs
diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go
@@ -208,3 +208,7 @@ func writeSourcesToSource(t *testing.T, base string, fs *hugofs.Fs, sources ...s
 		writeSource(t, fs, filepath.Join(base, src.Name), string(src.Content))
 	}
 }
+
+func isCI() bool {
+	return os.Getenv("CI") != ""
+}