update tests

This commit is contained in:
Jaremy Creechley 2023-09-14 21:35:58 -07:00
parent c3353bd665
commit 3825899b0b
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
3 changed files with 14 additions and 2 deletions

View File

@ -211,7 +211,7 @@ proc newThreadProxyDatastore*(
try:
value[].ds = ds
value[].tp = Taskpool.new(num_threads = 6)
value[].tp = Taskpool.new(num_threads = 2)
except Exception as exc:
return err((ref DatastoreError)(msg: exc.msg))

View File

@ -19,7 +19,7 @@ template checkNotNil(p: typed) =
when not defined(datastoreEchoedThread):
proc echoed*(vals: varargs[string]) =
template echoed*(vals: varargs[untyped]) =
discard
else:
import std/terminal

View File

@ -52,12 +52,24 @@ suite "Test Basic ThreadProxyDatastore":
val &= char(c)
# print "get res2: ", $val
suite "Test Basics":
var
mem = MemoryDatastore.new()
sds = newThreadProxyDatastore(mem).expect("should work")
let
key = Key.init("/a/b").tryGet()
bytes = "some bytes".toBytes
otherBytes = "some other bytes".toBytes
# echo "\n\n=== put cancel ==="
# # let res1 = await sds.put(key1, "value for 1".toBytes())
# let res3 = sds.put(key1, "value for 1".toBytes())
# res3.cancel()
# # print "res3: ", res3
basicStoreTests(sds, key, bytes, otherBytes)
# suite "Test Basic ThreadProxyDatastore":
# var