1
0
Fork 0

6 Commits (2f7672d8973a0a1d57ad1c460cec9e5d49fc9a18)

Author SHA1 Message Date
Eng Zer Jun 93eebc6e77
test: fix failing store_restart.test.go on Windows
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2 years ago
Eng Zer Jun 5141eff5fc
test: use `T.TempDir` to create temporary test directory
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2 years ago
Philip O'Toole 58adcb87c9 Fix Store unit tests 3 years ago
Philip O'Toole 6509070ce8 More STRONG queries to deal with races 3 years ago
Philip O'Toole f3a9b79b34 Close obsolete Listeners during Store testing 3 years ago
Philip O'Toole 33bee34f89 More Store restart testing 3 years ago