hugolib: Disable shaky leaktest on CI
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 13 Jun 2017 19:22:47 +0000 (21:22 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 13 Jun 2017 19:22:47 +0000 (21:22 +0200)
hugolib/hugo_sites_build_test.go
hugolib/testhelpers_test.go

index 988a369162bf50d7e33e5d5e90e75f1101911a86..e7d79165265f07fa00a7e574d6bf729d2e9fcede 100644 (file)
@@ -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
index c386e6203bb977c134a67fa04a707599314971d4..3db2d9d5136d948acee3bcd1916f27a1728e40c0 100644 (file)
@@ -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") != ""
+}