squash: remove `TmpFolder.ReadDir` and partially revert querylog test

This commit is contained in:
ThinkChaos 2023-11-30 20:25:21 -05:00
parent adb970af10
commit c5cc1120a9
2 changed files with 7 additions and 9 deletions

View File

@ -105,13 +105,6 @@ func (tf *TmpFolder) JoinPath(name string) string {
return filepath.Join(tf.Path, name)
}
func (tf *TmpFolder) ReadDir() []fs.DirEntry {
files, err := os.ReadDir(tf.Path)
Expect(err).Should(Succeed())
return files
}
func (tf *TmpFolder) createFile(name string) (*os.File, *TmpFile) {
var (
f *os.File

View File

@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"io/fs"
"os"
"time"
@ -115,11 +116,15 @@ var _ = Describe("FileWriter", func() {
})
})
Expect(tmpDir.ReadDir()).Should(HaveLen(2))
Eventually(func(g Gomega) ([]fs.DirEntry, error) {
return os.ReadDir(tmpDir.Path)
}, "20s", "1s").Should(HaveLen(2))
writer.CleanUp()
Expect(tmpDir.ReadDir()).Should(HaveLen(1))
Eventually(func(g Gomega) ([]fs.DirEntry, error) {
return os.ReadDir(tmpDir.Path)
}, "20s", "1s").Should(HaveLen(1))
})
})
})