Similarityoung commented on code in PR #833:
URL: https://github.com/apache/dubbo-go-pixiu/pull/833#discussion_r2616871283


##########
pkg/filter/metric/metric_test.go:
##########
@@ -259,13 +276,29 @@ func TestFilterWithPullMode(t *testing.T) {
 
 // TestFilterWithPushMode tests filter encode with push mode
 func TestFilterWithPushMode(t *testing.T) {
+       restore := withTempPromRegistry(t)
+       defer restore()
+
+       pushCh := make(chan struct{}, 1)
+       var pushHits int32
+       server := httptest.NewServer(http.HandlerFunc(func(w 
http.ResponseWriter, r *http.Request) {
+               io.Copy(io.Discard, r.Body)
+               atomic.AddInt32(&pushHits, 1)
+               select {
+               case pushCh <- struct{}{}:
+               default:
+               }
+               w.WriteHeader(http.StatusAccepted)
+       }))
+       defer server.Close()
+
        factory := &FilterFactory{
                cfg: &Config{
                        Mode: "push",
                        Push: PushConfig{
-                               GatewayURL:   "http://localhost:9091";,
+                               GatewayURL:   server.URL,

Review Comment:
   这里修改的意义是什么



##########
pkg/filter/metric/metric_test.go:
##########
@@ -409,14 +449,30 @@ func TestMetricReporterPullMode(t *testing.T) {
 
 // TestMetricReporterPushMode tests push mode with Prometheus Push Gateway.
 func TestMetricReporterPushMode(t *testing.T) {
+       restore := withTempPromRegistry(t)
+       defer restore()
+
+       pushCh := make(chan struct{}, 1)
+       var pushHits int32
+       server := httptest.NewServer(http.HandlerFunc(func(w 
http.ResponseWriter, r *http.Request) {
+               io.Copy(io.Discard, r.Body)
+               atomic.AddInt32(&pushHits, 1)
+               select {
+               case pushCh <- struct{}{}:
+               default:
+               }
+               w.WriteHeader(http.StatusAccepted)
+       }))
+       defer server.Close()
+
        // Create factory with push mode
        factory := &FilterFactory{
                cfg: &Config{
                        Mode: "push",
                        Push: PushConfig{
-                               GatewayURL:   "http://127.0.0.1:9091";,
+                               GatewayURL:   server.URL,

Review Comment:
   同上



##########
configs/conf.yaml:
##########
@@ -50,9 +50,9 @@ static_resources:
                     allow_credentials: false
 
       config:
-        idle_timeout: "5s"
-        read_timeout: "5s"
-        write_timeout: "5s"
+        idle_timeout: "5000ms"
+        read_timeout: "5000ms"
+        write_timeout: "5000ms"

Review Comment:
   这里需要修改成毫秒吗,这是配置 pixiu 本身的配置,需要跟 dubbo-go 配置同步吗



-- 
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