Skip to content

Commit

Permalink
faster the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan committed Nov 5, 2020
1 parent e76f44a commit 88333ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/stores/sqlc/cachedsql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/alicebob/miniredis"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/core/fx"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/stat"
"github.com/tal-tech/go-zero/core/stores/cache"
Expand Down Expand Up @@ -474,7 +475,10 @@ func TestCachedConnExec(t *testing.T) {
func TestCachedConnExecDropCache(t *testing.T) {
r, err := miniredis.Run()
assert.Nil(t, err)
defer r.Close()
defer fx.DoWithTimeout(func() error {
r.Close()
return nil
}, time.Second)

const (
key = "user"
Expand Down

0 comments on commit 88333ee

Please sign in to comment.