This commit is contained in:
James Mills 2022-04-04 10:36:48 +10:00
parent 061e2c7b1f
commit dbf3aedf5e
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
3 changed files with 32 additions and 1 deletions

View File

@ -207,7 +207,7 @@ func TestMessageBusSubscribeWithIndex(t *testing.T) {
assert.Equal("foo", string((<-msgs).Payload))
assert.Equal("bar", string((<-msgs).Payload))
//assert.Equal("baz", string((<-msgs).Payload))
assert.Equal("baz", string((<-msgs).Payload))
}
func TestMessageBusWAL(t *testing.T) {

31
tools/test_mkdirtemp.go Normal file
View File

@ -0,0 +1,31 @@
package main
import (
"fmt"
"log"
"os"
"path/filepath"
)
func main() {
logsDir, err := os.MkdirTemp("", "*-logs")
if err != nil {
log.Fatal(err)
}
defer os.RemoveAll(logsDir) // clean up
fmt.Printf("logsDir: %s", logsDir)
// Logs can be cleaned out earlier if needed by searching
// for all directories whose suffix ends in *-logs.
globPattern := filepath.Join(os.TempDir(), "*-logs")
matches, err := filepath.Glob(globPattern)
if err != nil {
log.Fatalf("Failed to match %q: %v", globPattern, err)
}
for _, match := range matches {
if err := os.RemoveAll(match); err != nil {
log.Printf("Failed to remove %q: %v", match, err)
}
}
}

BIN
tools/tools Executable file

Binary file not shown.