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") != "" +}