mirror of https://github.com/0xERR0R/blocky.git
squash: remove `TmpFolder.ReadDir` and partially revert querylog test
This commit is contained in:
parent
adb970af10
commit
c5cc1120a9
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue