From 508586ea7e2a863b263b4ef051b0390f143c68c2 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Tue, 22 Aug 2017 22:42:56 +0700 Subject: [PATCH] fix a race condition in server integration test setup --- integrationtests/gquic/server_test.go | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/integrationtests/gquic/server_test.go b/integrationtests/gquic/server_test.go index b553afd8f..c222f8b5c 100644 --- a/integrationtests/gquic/server_test.go +++ b/integrationtests/gquic/server_test.go @@ -79,19 +79,17 @@ var _ = Describe("Server tests", func() { // download files must be create *before* the quic_server is started // the quic_server reads its data dir on startup, and only serves those files that were already present then startServer := func() { - go func() { - defer GinkgoRecover() - var err error - command := exec.Command( - serverPath, - "--quic_response_cache_dir="+filepath.Join(tmpDir, "quic.clemente.io"), - "--key_file="+filepath.Join(tmpDir, "key.pkcs8"), - "--certificate_file="+filepath.Join(tmpDir, "cert.pem"), - "--port="+serverPort, - ) - session, err = Start(command, nil, GinkgoWriter) - Expect(err).NotTo(HaveOccurred()) - }() + defer GinkgoRecover() + var err error + command := exec.Command( + serverPath, + "--quic_response_cache_dir="+filepath.Join(tmpDir, "quic.clemente.io"), + "--key_file="+filepath.Join(tmpDir, "key.pkcs8"), + "--certificate_file="+filepath.Join(tmpDir, "cert.pem"), + "--port="+serverPort, + ) + session, err = Start(command, nil, GinkgoWriter) + Expect(err).NotTo(HaveOccurred()) } stopServer := func() {