MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / runNutsDBTestWithWatch

Function runNutsDBTestWithWatch

db_test.go:104–117  ·  view source on GitHub ↗
(t *testing.T, test func(t *testing.T, db *DB))

Source from the content-addressed store, hash-verified

102}
103
104func runNutsDBTestWithWatch(t *testing.T, test func(t *testing.T, db *DB)) {
105 option := DefaultOptions
106 option.EnableWatch = true
107
108 //actively close the watch manager, to cancel the watcher
109 testWithCloseWatchManager := func(t *testing.T, db *DB) {
110 test(t, db)
111 if !db.IsClose() && db.watchMgr != nil && !db.watchMgr.isClosed() {
112 require.NoError(t, db.watchMgr.close())
113 }
114 }
115
116 runNutsDBTest(t, &option, testWithCloseWatchManager)
117}
118
119func txPut(t *testing.T, db *DB, bucket string, key, value []byte, ttl uint32, expectErr error, finalExpectErr error) {
120 err := db.Update(func(tx *Tx) error {

Callers 3

TestDB_WatchFunction · 0.85
TestDB_WatchTTLFunction · 0.85
TestDB_WatchDeleteBucketFunction · 0.85

Calls 4

runNutsDBTestFunction · 0.85
IsCloseMethod · 0.80
isClosedMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected