Test tracing more thoroughly, do not encode forwarded messages twice
commit10bdf679944fb61edb86d25bff7ae556551fedb0
authorTim Watson <tim@rabbitmq.com>
dateThu 9 May 2013, 21:34 (13 years ago)
parente78ee28
src/Control/Distributed/Process/Internal/Primitives.hs+1−1
@@ -410,7 +410,7 @@ forward msg them = do
410410 -- We do not fire the trace event until after the sending is complete;
411411 -- In the remote case, 'sendMessage' can block in the networking stack.
412412 liftIO $ traceEvent (localTracer node)
413− (TraceEvSent them us (createUnencodedMessage msg))
413+ (TraceEvSent them us msg)
414414
415415
416416-- | Wrap a 'Serializable' value in a 'Message'. Note that 'Message's are
tests/TestTracing.hs+3−1
@@ -153,7 +153,9 @@ testTraceSending result = do
153153 withTracer
154154 (\ev ->
155155 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")
157159 stash res (to == pid && from == self)
158160 _ ->
159161 return ()) $ do