diff options
author | Bjørn Erik Pedersen <[email protected]> | 2017-06-13 21:22:47 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2017-06-13 21:22:47 +0200 |
commit | 5103935ae80536fbe0624c408016cdcbd1f03c1d (patch) | |
tree | 34e14b1056d7045e3b9e9f7cf284f2dfeaebb167 | |
parent | 95386544e858949a2baa414f395f30aaf66a6257 (diff) | |
download | hugo-5103935ae80536fbe0624c408016cdcbd1f03c1d.tar.gz hugo-5103935ae80536fbe0624c408016cdcbd1f03c1d.zip |
hugolib: Disable shaky leaktest on CI
-rw-r--r-- | hugolib/hugo_sites_build_test.go | 6 | ||||
-rw-r--r-- | hugolib/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 index 988a36916..e7d791652 100644 --- 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 index c386e6203..3db2d9d51 100644 --- 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") != "" +} |