AlexStocks commented on code in PR #1023:
URL: https://github.com/apache/dubbo-go-pixiu/pull/1023#discussion_r3878271065


##########
pkg/client/dubbo/call_test.go:
##########
@@ -250,6 +251,24 @@ func 
TestWithAttachmentsPropagatesExternalSpanWhenTracingDisabled(t *testing.T)
        require.Equal(t, 
"00-01000000000000000000000000000000-0200000000000000-01", 
attachments["traceparent"])
 }
 
+func TestWithAttachmentsPropagatesBaggageWithoutSpanWhenTracingDisabled(t 
*testing.T) {
+       restorePropagator(t, 
propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, 
propagation.Baggage{}))
+       previousTracingEnabled := tracingEnabled.Load()
+       t.Cleanup(func() { SetTracingEnabled(previousTracingEnabled) })
+       SetTracingEnabled(false)
+
+       member, err := baggage.NewMember("tenant", "blue")
+       require.NoError(t, err)
+       bag, err := baggage.New(member)
+       require.NoError(t, err)
+       ctx := baggage.ContextWithBaggage(context.Background(), bag)
+       ctx = withAttachments(ctx, nil)

Review Comment:
   [P1] 回归测试需要经过 `Client.Call` 的真实生产链
   
   这里直接调用私有 `withAttachments`,只证明 helper 能把 baggage 写进 context;即使后续 
`Client.Call` 不再调用它、在 `GenericService.Invoke` 前替换 context,或 HTTP outbound 
路径没有传入入口 context,本测试仍会通过,因此不能证明 release note 声称的 Dubbo proxy 请求已保留 
baggage。请改为调用 `Client.Call`,通过缓存的 `GenericService.Invoke` 回调断言最终 
`AttachmentKey` 中的 `baggage=tenant=blue`,并用 Base 或撤销 fast-path 修复的 mutant 
证明旧错误会失败。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to