multi: replace defer cleanup with t.Cleanup

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2022-08-27 15:04:55 +08:00
parent 5c5997935d
commit c70e39cd21
29 changed files with 393 additions and 606 deletions

View File

@@ -20,9 +20,8 @@ func TestForwardingLogBasicStorageAndQuery(t *testing.T) {
// First, we'll set up a test database, and use that to instantiate the
// forwarding event log that we'll be using for the duration of the
// test.
db, cleanUp, err := MakeTestDB()
db, err := MakeTestDB(t)
require.NoError(t, err, "unable to make test db")
defer cleanUp()
log := ForwardingLog{
db: db,
@@ -89,9 +88,8 @@ func TestForwardingLogQueryOptions(t *testing.T) {
// First, we'll set up a test database, and use that to instantiate the
// forwarding event log that we'll be using for the duration of the
// test.
db, cleanUp, err := MakeTestDB()
db, err := MakeTestDB(t)
require.NoError(t, err, "unable to make test db")
defer cleanUp()
log := ForwardingLog{
db: db,
@@ -189,9 +187,8 @@ func TestForwardingLogQueryLimit(t *testing.T) {
// First, we'll set up a test database, and use that to instantiate the
// forwarding event log that we'll be using for the duration of the
// test.
db, cleanUp, err := MakeTestDB()
db, err := MakeTestDB(t)
require.NoError(t, err, "unable to make test db")
defer cleanUp()
log := ForwardingLog{
db: db,
@@ -301,9 +298,8 @@ func TestForwardingLogStoreEvent(t *testing.T) {
// First, we'll set up a test database, and use that to instantiate the
// forwarding event log that we'll be using for the duration of the
// test.
db, cleanUp, err := MakeTestDB()
db, err := MakeTestDB(t)
require.NoError(t, err, "unable to make test db")
defer cleanUp()
log := ForwardingLog{
db: db,