Skip to content

Commit 6bd8cc5

Browse files
fix tests
Signed-off-by: [email protected] <[email protected]>
1 parent 1e3ca54 commit 6bd8cc5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

platform/view/services/storage/driver/sql/postgres/binding_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,28 @@ import (
1515
"github.com/stretchr/testify/require"
1616
)
1717

18-
func newBindingStoreForTests(t *testing.T) *BindingStore {
18+
func newBindingStoreForTests(t *testing.T) (func(), *BindingStore) {
1919
t.Log("starting postgres")
2020
terminate, pgConnStr, err := StartPostgres(t, false)
2121
require.NoError(t, err)
22-
defer terminate()
2322
t.Log("postgres ready")
2423

2524
cp := NewConfigProvider(testing2.MockConfig(Config{
2625
DataSource: pgConnStr,
2726
}))
2827
db, err := NewPersistenceWithOpts(cp, NewDbProvider(), "", NewBindingStore)
2928
require.NoError(t, err)
30-
return db
29+
return terminate, db
3130
}
3231

3332
func TestPutBindingsMultipleEphemeralsPostgres(t *testing.T) {
34-
db := newBindingStoreForTests(t)
33+
terminate, db := newBindingStoreForTests(t)
34+
defer terminate()
3535
common.TestPutBindingsMultipleEphemeralsCommon(t, db.BindingStore)
3636
}
3737

3838
func TestManyManyPutBindingsSqlite(t *testing.T) {
39-
db := newBindingStoreForTests(t)
39+
terminate, db := newBindingStoreForTests(t)
40+
defer terminate()
4041
common.TestManyManyPutBindingsCommon(t, db.BindingStore)
4142
}

0 commit comments

Comments
 (0)