git.iko.soy/distributed-process
on master help sign in
Test tracing more thoroughly, do not encode forwarded messages twice
10bdf67Tim Watson
src/Control/Distributed/Process/Internal/Primitives.hs+1−1
@@ -410,7 +410,7 @@ forward msg them = do
410 -- We do not fire the trace event until after the sending is complete;
410 -- We do not fire the trace event until after the sending is complete;
411 -- In the remote case, 'sendMessage' can block in the networking stack.
411 -- In the remote case, 'sendMessage' can block in the networking stack.
412 liftIO $ traceEvent (localTracer node)
412 liftIO $ traceEvent (localTracer node)
413− (TraceEvSent them us (createUnencodedMessage msg))
413+ (TraceEvSent them us msg)
414
414
415
415
416-- | Wrap a 'Serializable' value in a 'Message'. Note that 'Message's are
416-- | Wrap a 'Serializable' value in a 'Message'. Note that 'Message's are
tests/TestTracing.hs+3−1
@@ -153,7 +153,9 @@ testTraceSending result = do
153 withTracer
153 withTracer
154 (\ev ->
154 (\ev ->
155 case ev of
155 case ev of
156− (TraceEvSent to from _) ->
156+ (TraceEvSent to from msg) -> do
157+ (Just s) <- unwrapMessage msg :: Process (Maybe String)
158+ stash res (to == pid && from == self && s == "hello there")
157 stash res (to == pid && from == self)
159 stash res (to == pid && from == self)
158 _ ->
160 _ ->
159 return ()) $ do
161 return ()) $ do