Commit bc0ea4bf authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 547b77af
...@@ -36,6 +36,7 @@ import os, os.path, subprocess, threading ...@@ -36,6 +36,7 @@ import os, os.path, subprocess, threading
from errno import EINVAL from errno import EINVAL
from golang import go, chan, func, defer, select from golang import go, chan, func, defer, select
from golang import context from golang import context
from golang.x.sync import errgroup
from zodbtools.util import ashex as h, fromhex from zodbtools.util import ashex as h, fromhex
from pytest import raises from pytest import raises
from .internal import mm from .internal import mm
...@@ -650,18 +651,18 @@ def test_wcfs(): ...@@ -650,18 +651,18 @@ def test_wcfs():
w = t.openwatch() w = t.openwatch()
ctx = context.background() # XXX stub ctx = context.background() # XXX stub
wg, ctx = errgroup.with_context(ctx)
done = chan()
@func
def _(): def _():
defer(done.close)
pinv = w.expectPin(ctx, [(zf, 2, at1), (zf, 3, at0)]) pinv = w.expectPin(ctx, [(zf, 2, at1), (zf, 3, at0)])
#pinv = w.expectPin(ctx, {zf: [(2, at1), (3, at0)]}) XXX <- this way better? (sugar) #pinv = w.expectPin(ctx, {zf: [(2, at1), (3, at0)]}) XXX <- this way better? (sugar)
for p in pinv: for p in pinv:
p.reply(b"ack") p.reply(b"ack")
go(_) wg.go(_)
assert w.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1))) == "ok" def _():
done.recv() assert w.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1))) == "ok"
wg.go(_)
wg.wait()
print('\nCCC\n') print('\nCCC\n')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment