You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/12/22 22:06:09 UTC

[GitHub] [beam] lostluck commented on a change in pull request #16331: [BEAM-13399] Add extra time buffer to reduce likelihood of flake in expansion service test

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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org