Harden host deletion and test stability
This commit is contained in:
@@ -2,12 +2,11 @@ package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http/httptest"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"sub2api-cn-relay-manager/internal/store/sqlite"
|
||||
"sub2api-cn-relay-manager/internal/testutil"
|
||||
)
|
||||
|
||||
func TestResumePendingBatchImportRunsCompletesStoredRun(t *testing.T) {
|
||||
@@ -16,11 +15,8 @@ func TestResumePendingBatchImportRunsCompletesStoredRun(t *testing.T) {
|
||||
server := httptest.NewServer(newBatchImportActionStubServer(t))
|
||||
defer server.Close()
|
||||
|
||||
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)
|
||||
}
|
||||
dsn := testutil.SQLiteTestDSN(t, "state.db", true)
|
||||
store := testutil.OpenSQLiteStore(t, dsn)
|
||||
defer closeAppTestStore(t, store)
|
||||
if _, err := store.SQLDB().Exec("PRAGMA foreign_keys = OFF"); err != nil {
|
||||
t.Fatalf("disable foreign keys pragma error = %v", err)
|
||||
|
||||
Reference in New Issue
Block a user