aboutsummaryrefslogtreecommitdiff
path: root/simulation_test.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2016-01-02 22:34:41 -0700
committerBen Johnson <benbjohnson@yahoo.com>2016-01-02 22:34:41 -0700
commit34a0fa5307f7562980fb8e7ff4723f7987edf49b (patch)
tree26a01c0d5a3da53f45c7f54062c3af11479c4a2f /simulation_test.go
parentMerge pull request #474 from elithrar/patch-1 (diff)
parenttest suite refactoring (diff)
downloaddedo-34a0fa5307f7562980fb8e7ff4723f7987edf49b.tar.gz
dedo-34a0fa5307f7562980fb8e7ff4723f7987edf49b.tar.xz
Merge pull request #477 from benbjohnson/testing
Test suite refactoring
Diffstat (limited to 'simulation_test.go')
-rw-r--r--simulation_test.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/simulation_test.go b/simulation_test.go
index ceb8bae..c691527 100644
--- a/simulation_test.go
+++ b/simulation_test.go
@@ -42,8 +42,8 @@ func testSimulate(t *testing.T, threadCount, parallelism int) {
var versions = make(map[int]*QuickDB)
versions[1] = NewQuickDB()
- db := NewTestDB()
- defer db.Close()
+ db := MustOpenDB()
+ defer db.MustClose()
var mutex sync.Mutex
@@ -89,10 +89,12 @@ func testSimulate(t *testing.T, threadCount, parallelism int) {
versions[tx.ID()] = qdb
mutex.Unlock()
- ok(t, tx.Commit())
+ if err := tx.Commit(); err != nil {
+ t.Fatal(err)
+ }
}()
} else {
- defer tx.Rollback()
+ defer func() { _ = tx.Rollback() }()
}
// Ignore operation if we don't have data yet.