From 5103935ae80536fbe0624c408016cdcbd1f03c1d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 13 Jun 2017 21:22:47 +0200 Subject: [PATCH] hugolib: Disable shaky leaktest on CI --- hugolib/hugo_sites_build_test.go | 6 ++++-- 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 988a3691..e7d79165 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 c386e620..3db2d9d5 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") != "" +} -- 2.30.2