Harden host deletion and test stability
This commit is contained in:
@@ -4,12 +4,12 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"sub2api-cn-relay-manager/internal/host/sub2api"
|
||||
"sub2api-cn-relay-manager/internal/pack"
|
||||
"sub2api-cn-relay-manager/internal/store/sqlite"
|
||||
"sub2api-cn-relay-manager/internal/testutil"
|
||||
)
|
||||
|
||||
func TestRerunAccountProbesReturnsErrorForInvalidProbeSummary(t *testing.T) {
|
||||
@@ -513,13 +513,7 @@ type reconcileFixture struct {
|
||||
|
||||
func openReconcileTestStore(t *testing.T) *sqlite.DB {
|
||||
t.Helper()
|
||||
|
||||
dsn := fmt.Sprintf("file:%s?_busy_timeout=5000&_pragma=foreign_keys(0)", filepath.ToSlash(filepath.Join(t.TempDir(), "state.db")))
|
||||
store, err := sqlite.Open(context.Background(), dsn)
|
||||
if err != nil {
|
||||
t.Fatalf("sqlite.Open() error = %v", err)
|
||||
}
|
||||
return store
|
||||
return testutil.OpenSQLiteStore(t, testutil.SQLiteTestDSN(t, "state.db", true))
|
||||
}
|
||||
|
||||
func closeReconcileTestStore(t *testing.T, store *sqlite.DB) {
|
||||
|
||||
Reference in New Issue
Block a user