@@ -206,9 +206,10 @@ func TestRejectRequestsByDefault(t *testing.T) {
206
206
"request(0)->executeTask(0)" ,
207
207
"request(0)->terminateRequest(0)" ,
208
208
"processResponses(0)->loaderProcess(0)->cacheProcess(0)" ,
209
- "response (0)->transaction(0)->execute(0)->buildMessage(0)" ,
209
+ "processRequests (0)->transaction(0)->execute(0)->buildMessage(0)" ,
210
210
"message(0)->sendMessage(0)" ,
211
211
"message(1)->sendMessage(0)" ,
212
+ "response(0)" ,
212
213
}, tracing .TracesToStrings ())
213
214
// has ContextCancelError exception recorded in the right place
214
215
tracing .SingleExceptionEvent (t , "request(0)->executeTask(0)" , "ContextCancelError" , ipldutil.ContextCancelError {}.Error (), false )
@@ -561,7 +562,7 @@ func TestGraphsyncRoundTripIgnoreCids(t *testing.T) {
561
562
testutil .RepeatTraceStrings ("request(0)->verifyBlock({})" , 50 )... ), // half of the full chain
562
563
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->loadBlock(0)" , blockChainLength )... ),
563
564
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->sendBlock(0)->processBlockHooks(0)" , blockChainLength )... ),
564
- testutil .RepeatTraceStrings ("response (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 2 )... ,
565
+ testutil .RepeatTraceStrings ("processRequests (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 2 )... ,
565
566
), tracing .TracesToStrings ())
566
567
}
567
568
@@ -635,7 +636,7 @@ func TestGraphsyncRoundTripIgnoreNBlocks(t *testing.T) {
635
636
testutil .RepeatTraceStrings ("request(0)->verifyBlock({})" , 50 )... ),
636
637
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->loadBlock(0)" , blockChainLength )... ),
637
638
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->sendBlock(0)->processBlockHooks(0)" , blockChainLength )... ),
638
- testutil .RepeatTraceStrings ("response (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 2 )... ,
639
+ testutil .RepeatTraceStrings ("processRequests (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 2 )... ,
639
640
), tracing .TracesToStrings ())
640
641
}
641
642
@@ -887,6 +888,7 @@ func TestPauseResumeViaUpdate(t *testing.T) {
887
888
"request(0)->newRequest(0)" ,
888
889
"request(0)->executeTask(0)" ,
889
890
"request(0)->terminateRequest(0)" ,
891
+ "processRequests(1)" ,
890
892
},
891
893
processResponsesTraces (t , tracing , responseCount )... ),
892
894
testutil .RepeatTraceStrings ("message({})->sendMessage(0)" , responseCount + 2 )... ),
@@ -895,13 +897,23 @@ func TestPauseResumeViaUpdate(t *testing.T) {
895
897
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->sendBlock(0)->processBlockHooks(0)" , 50 )... ), // half of the full chain
896
898
testutil .RepeatTraceStrings ("response(0)->executeTask(1)->processBlock({})->loadBlock(0)" , 50 )... ),
897
899
testutil .RepeatTraceStrings ("response(0)->executeTask(1)->processBlock({})->sendBlock(0)->processBlockHooks(0)" , 50 )... ), // half of the full chain
898
- testutil .RepeatTraceStrings ("response (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 3 )... ,
900
+ testutil .RepeatTraceStrings ("processRequests (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 3 )... ,
899
901
), tracing .TracesToStrings ())
900
902
// make sure the attributes are what we expect
901
903
processUpdateSpan := tracing .FindSpanByTraceString ("response(0)->processUpdate(0)" )
902
904
require .Equal (t , []string {string (td .extensionName )}, testutil .AttributeValueInTraceSpan (t , * processUpdateSpan , "extensions" ).AsStringSlice ())
903
905
// pause recorded
904
906
tracing .SingleExceptionEvent (t , "response(0)->executeTask(0)" , "github.com/ipfs/go-graphsync/responsemanager/hooks.ErrPaused" , hooks.ErrPaused {}.Error (), false )
907
+
908
+ message0Span := tracing .FindSpanByTraceString ("processRequests(0)" )
909
+ message1Span := tracing .FindSpanByTraceString ("processRequests(1)" )
910
+ responseSpan := tracing .FindSpanByTraceString ("response(0)" )
911
+ // response(0) originates in processRequests(0)
912
+ require .Len (t , responseSpan .Links , 1 )
913
+ require .Equal (t , responseSpan .Links [0 ].SpanContext .SpanID (), message0Span .SpanContext .SpanID ())
914
+ // response(0)->processUpdate(0) occurs thanks to processRequests(1)
915
+ require .Len (t , processUpdateSpan .Links , 1 )
916
+ require .Equal (t , processUpdateSpan .Links [0 ].SpanContext .SpanID (), message1Span .SpanContext .SpanID ())
905
917
}
906
918
907
919
func TestPauseResumeViaUpdateOnBlockHook (t * testing.T ) {
@@ -980,6 +992,7 @@ func TestPauseResumeViaUpdateOnBlockHook(t *testing.T) {
980
992
"request(0)->newRequest(0)" ,
981
993
"request(0)->executeTask(0)" ,
982
994
"request(0)->terminateRequest(0)" ,
995
+ "processRequests(1)" ,
983
996
},
984
997
processResponsesTraces (t , tracing , responseCount )... ),
985
998
testutil .RepeatTraceStrings ("message({})->sendMessage(0)" , responseCount + 2 )... ),
@@ -988,7 +1001,7 @@ func TestPauseResumeViaUpdateOnBlockHook(t *testing.T) {
988
1001
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->sendBlock(0)->processBlockHooks(0)" , 50 )... ), // half of the full chain
989
1002
testutil .RepeatTraceStrings ("response(0)->executeTask(1)->processBlock({})->loadBlock(0)" , 50 )... ),
990
1003
testutil .RepeatTraceStrings ("response(0)->executeTask(1)->processBlock({})->sendBlock(0)->processBlockHooks(0)" , 50 )... ), // half of the full chain
991
- testutil .RepeatTraceStrings ("response (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 3 )... ,
1004
+ testutil .RepeatTraceStrings ("processRequests (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 3 )... ,
992
1005
), tracing .TracesToStrings ())
993
1006
// make sure the attributes are what we expect
994
1007
processUpdateSpan := tracing .FindSpanByTraceString ("response(0)->processUpdate(0)" )
@@ -1074,6 +1087,7 @@ func TestNetworkDisconnect(t *testing.T) {
1074
1087
tracing := collectTracing (t )
1075
1088
1076
1089
traceStrings := tracing .TracesToStrings ()
1090
+ require .Contains (t , traceStrings , "processRequests(0)->transaction(0)->execute(0)->buildMessage(0)" )
1077
1091
require .Contains (t , traceStrings , "response(0)->executeTask(0)->processBlock(0)->loadBlock(0)" )
1078
1092
require .Contains (t , traceStrings , "response(0)->executeTask(0)->processBlock(0)->sendBlock(0)->processBlockHooks(0)" )
1079
1093
require .Contains (t , traceStrings , "response(0)->abortRequest(0)" )
@@ -1370,7 +1384,7 @@ func TestRoundTripLargeBlocksSlowNetwork(t *testing.T) {
1370
1384
testutil .RepeatTraceStrings ("request(0)->verifyBlock({})" , blockChainLength )... ),
1371
1385
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->loadBlock(0)" , blockChainLength )... ),
1372
1386
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->sendBlock(0)->processBlockHooks(0)" , blockChainLength )... ),
1373
- testutil .RepeatTraceStrings ("response (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 2 )... ,
1387
+ testutil .RepeatTraceStrings ("processRequests (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 2 )... ,
1374
1388
), tracing .TracesToStrings ())
1375
1389
}
1376
1390
@@ -1610,7 +1624,7 @@ func TestGraphsyncBlockListeners(t *testing.T) {
1610
1624
testutil .RepeatTraceStrings ("request(0)->verifyBlock({})" , blockChainLength )... ),
1611
1625
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->loadBlock(0)" , blockChainLength )... ),
1612
1626
testutil .RepeatTraceStrings ("response(0)->executeTask(0)->processBlock({})->sendBlock(0)->processBlockHooks(0)" , blockChainLength )... ),
1613
- testutil .RepeatTraceStrings ("response (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 2 )... ,
1627
+ testutil .RepeatTraceStrings ("processRequests (0)->transaction({})->execute(0)->buildMessage(0)" , blockChainLength + 2 )... ,
1614
1628
), tracing .TracesToStrings ())
1615
1629
}
1616
1630
0 commit comments