lostluck commented on a change in pull request #16331:
URL: https://github.com/apache/beam/pull/16331#discussion_r774203240
##########
File path: sdks/go/test/integration/xlang/expansion_test.go
##########
@@ -33,16 +34,21 @@ const (
expansionPort = "8097"
)
-func checkPort(t *testing.T, port string) {
- ping := exec.Command("nc", "-vz", "localhost", port)
- output, err := ping.CombinedOutput()
- if err != nil {
- t.Errorf("failed to run ping to localhost:%v", port)
- }
- outputStr := string(output)
- if strings.Contains(outputStr, "failed") {
- t.Errorf("failed to connect to localhost:%v, got err %v", port,
outputStr)
+func checkPort(t *testing.T, port string, durationSeconds float64) {
Review comment:
Nit: use a time.Duration instead, then everything can work in the same
units.
eg pass in a 15 * time.Second
&then precalculate interval and use it in the loop...
https://go.dev/play/p/hkmgtbCX191
--
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]