Alanxtl commented on code in PR #3690:
URL: https://github.com/apache/dubbo-go/pull/3690#discussion_r3836012072
##########
remoting/etcdv3/client_test.go:
##########
@@ -59,23 +59,58 @@ func (m *mockClientFacade) GetURL() *common.URL { return
m.url }
func (m *mockClientFacade) IsAvailable() bool { return true }
func (m *mockClientFacade) Destroy() {}
+// runOrSkipOnHang runs fn in a goroutine and waits up to timeout for it to
+// return, skipping the test with a clear diagnostic instead of hanging (or
+// asserting an outcome we can no longer guarantee) if it doesn't.
+//
+// These tests construct an etcd client against an address with nothing
+// listening, deliberately: they exercise what happens when etcd is
+// unreachable. That used to resolve in a bounded time because gost's
+// NewClient dialed with grpc.WithBlock(). dubbogo/gost@3412137 removed that
+// without bounding the synchronous keepSession call it guards (etcd
+// concurrency.NewSession, which grants a lease over RPC with no deadline
+// attached - see database/kv/etcd/v3/client.go in dubbogo/gost), so
+// NewClient can now hang indefinitely against an unreachable server
+// regardless of the timeout passed to it. That's a real upstream bug,
+// reported/fix pending at dubbogo/gost; skip here rather than either hang
+// or assert behavior the current dependency can't deliver.
+func runOrSkipOnHang(t *testing.T, timeout time.Duration, fn func()) {
Review Comment:
这些runOrSkipOnHang都是用来干啥的
##########
.github/workflows/github-actions.yml:
##########
@@ -41,13 +41,46 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
+ # Set at job level (not just on one step) so every step below - Run unit
+ # tests and Race Test alike - explicitly points config_center/zookeeper's
+ # tests at the service container. That's also what makes
+ # failOrSkipZkUnavailable (config_center/zookeeper/impl_test.go) fail
+ # those tests instead of skipping them if the server it names isn't
+ # reachable: ZK_ADDR being set here is this job asserting "a ZooKeeper
+ # must be up", so an unreachable one is this job's own regression, not
+ # something to pass over quietly.
+ env:
Review Comment:
加这个干啥
我们集成测试docker会启动zookeeper的
##########
go.mod:
##########
@@ -64,10 +65,10 @@ require (
go.yaml.in/yaml/v4 v4.0.0-rc.6
golang.org/x/net v0.56.0
golang.org/x/sync v0.21.0
- golang.org/x/tools v0.47.0
google.golang.org/grpc v1.64.1
google.golang.org/protobuf v1.34.2
gopkg.in/natefinch/lumberjack.v2 v2.2.1
+ gopkg.in/yaml.v3 v3.0.1
Review Comment:
为啥又引用了yaml.v3
我们统一使用go.yaml.in/yaml/v4
--
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]