Skip to content

Commit

Permalink
fix postgres wait
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-fischer committed Oct 2, 2024
1 parent 3cefe48 commit b338031
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions management/server/sql_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,17 +716,17 @@ func newAccount(store Store, id int) error {
func newPostgresqlStore(t *testing.T) *SqlStore {
t.Helper()

postgresDsn, ok := os.LookupEnv(postgresDsnEnv)
if !ok {
t.Fatalf("could not initialize postgresql store: %s is not set", postgresDsnEnv)
}

cleanUp, err := testutil.CreatePGDB()
if err != nil {
t.Fatal(err)
}
t.Cleanup(cleanUp)

postgresDsn, ok := os.LookupEnv(postgresDsnEnv)
if !ok {
t.Fatalf("could not initialize postgresql store: %s is not set", postgresDsnEnv)
}

store, err := NewPostgresqlStore(context.Background(), postgresDsn, nil)
if err != nil {
t.Fatalf("could not initialize postgresql store: %s", err)
Expand All @@ -740,8 +740,8 @@ func newPostgresqlStore(t *testing.T) *SqlStore {
func newPostgresqlStoreFromSqlite(t *testing.T, filename string) *SqlStore {
t.Helper()

store, _, err := NewSqliteTestStore(context.Background(), t.TempDir(), filename)
// t.Cleanup(cleanUpQ)
store, cleanUpQ, err := NewSqliteTestStore(context.Background(), t.TempDir(), filename)
t.Cleanup(cleanUpQ)
if err != nil {
return nil
}
Expand All @@ -751,11 +751,11 @@ func newPostgresqlStoreFromSqlite(t *testing.T, filename string) *SqlStore {
t.Fatalf("could not initialize postgresql store: %s is not set", postgresDsnEnv)
}

_, err = testutil.CreatePGDB()
cleanUpP, err := testutil.CreatePGDB()
if err != nil {
t.Fatal(err)
}
// t.Cleanup(cleanUpP)
t.Cleanup(cleanUpP)

pstore, err := NewPostgresqlStoreFromSqlStore(context.Background(), store, postgresDsn, nil)
require.NoError(t, err)
Expand Down

0 comments on commit b338031

Please sign in to comment.