fix: Always remove all tmp directories after completing the tests
@@ -133,6 +133,9 @@ var _ = AfterSuite(func() {
err := uninstallCluster()
Expect(err).NotTo(HaveOccurred())
+ out, err = cleanupTmp()
+ Expect(err).NotTo(HaveOccurred(), out)
+
fmt.Printf("Deleting tmpdir on node %d\n", config.GinkgoConfig.ParallelNode)
deleteTmpDir()
})
@@ -291,6 +294,13 @@ func uninstallEpinio() (string, error) {
return Epinio("uninstall", "")
}
+// Remove all tmp directories from /tmp/epinio-* . Test should try to cleanup
+// after themselves but that sometimes doesn't happen, either because we forgot
+// the cleanup code or because the test failed before that happened.
+func cleanupTmp() (string, error) {
+ return RunProc("rm -rf /tmp/epinio-*", "", false)
+}
+
// Epinio invokes the `epinio` binary, running the specified command.
// It returns the command output and/or error.
// dir parameter defines the directory from which the command should be run.
