(t *testing.T)
| 181 | } |
| 182 | |
| 183 | func TestTransactionManager_RejectTxWhenNotRunning(t *testing.T) { |
| 184 | db := &DB{} |
| 185 | sm := NewStatusManager(DefaultStatusManagerConfig()) |
| 186 | defer func() { _ = sm.Close() }() |
| 187 | |
| 188 | if err := sm.Start(); err != nil { |
| 189 | t.Fatalf("Failed to start StatusManager: %v", err) |
| 190 | } |
| 191 | |
| 192 | tm := newTxManager(db, sm) |
| 193 | |
| 194 | tx := &Tx{id: 1, db: db} |
| 195 | if err := tm.RegisterTx(tx); err != nil { |
| 196 | t.Errorf("RegisterTx should work even when TransactionManager is not running (only checks StatusManager), got: %v", err) |
| 197 | } |
| 198 | |
| 199 | tm.UnregisterTx(tx.id) |
| 200 | } |
| 201 | |
| 202 | func TestTransactionManager_WaitForActiveTxs(t *testing.T) { |
| 203 | db := &DB{} |
nothing calls this directly
no test coverage detected