Commit 53127d52 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 310b2283
...@@ -34,10 +34,11 @@ from persistent.timestamp import TimeStamp ...@@ -34,10 +34,11 @@ from persistent.timestamp import TimeStamp
import os, os.path, subprocess, threading 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 chan, func, defer, select
from golang import context, sync from golang import context, sync
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 six import reraise
from .internal import mm from .internal import mm
# setup: # setup:
...@@ -438,7 +439,12 @@ class tWatch: ...@@ -438,7 +439,12 @@ class tWatch:
# XXX in particular if there is a silly - e.g. syntax or type error in # XXX in particular if there is a silly - e.g. syntax or type error in
# test code - we curently get stuck here. # test code - we curently get stuck here.
print('# serveDone.recv() ...') print('# serveDone.recv() ...')
t._serveWG.wait() try:
t._serveWG.wait()
except Exception as e:
# canceled is expected and ok
if e != context.canceled:
reraise(e, None, e.__traceback__)
print('# serveDone ready') print('# serveDone ready')
t.wtx.close() t.wtx.close()
...@@ -477,7 +483,7 @@ class tWatch: ...@@ -477,7 +483,7 @@ class tWatch:
(rxq.send, msg), # 1 (rxq.send, msg), # 1
) )
if _ == 0: if _ == 0:
raise ctx.err() # XXX ok? -> or just return? raise ctx.err()
else: else:
with t._rxmu: with t._rxmu:
assert stream not in t._accepted assert stream not in t._accepted
...@@ -487,7 +493,7 @@ class tWatch: ...@@ -487,7 +493,7 @@ class tWatch:
(t._acceptq.send, (stream, msg)), # 1 (t._acceptq.send, (stream, msg)), # 1
) )
if _ == 0: if _ == 0:
raise ctx.err() # XXX ok? -> or just return? raise ctx.err()
# _send sends raw message via specified stream. # _send sends raw message via specified stream.
......
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