From 273a566891699cf07c0518c8e9b24f2ffc37720d Mon Sep 17 00:00:00 2001 From: Ruben Vargas Date: Wed, 23 Oct 2019 09:49:58 -0500 Subject: [PATCH] Use wait poll for testing Signed-off-by: Ruben Vargas --- go.mod | 4 ---- test/e2e/elasticsearch_token_propagation_test.go | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 7ac16fb29a..061d14e2b0 100644 --- a/go.mod +++ b/go.mod @@ -21,10 +21,6 @@ require ( github.com/uber/jaeger-lib v1.5.0 // indirect golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect - golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582 - golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect - golang.org/x/sys v0.0.0-20191018095205-727590c5006e // indirect - golang.org/x/tools v0.0.0-20191018000036-341939e08647 // indirect golang.org/x/net v0.0.0-20191021144547-ec77196f6094 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7 // indirect diff --git a/test/e2e/elasticsearch_token_propagation_test.go b/test/e2e/elasticsearch_token_propagation_test.go index a2ca9f3841..c539b8e6d7 100644 --- a/test/e2e/elasticsearch_token_propagation_test.go +++ b/test/e2e/elasticsearch_token_propagation_test.go @@ -6,6 +6,7 @@ import ( "bytes" goctx "context" "crypto/tls" + "errors" "io/ioutil" "net/http" "net/http/cookiejar" @@ -93,10 +94,14 @@ func (suite *TokenPropagationTestSuite) TestTokenPropagationTest() { resp, err := client.Do(req) require.NoError(t, err) require.Equal(t, http.StatusOK, resp.StatusCode) + if resp.StatusCode != http.StatusOK { + return false, errors.New("Query service returns http code: " + string(resp.StatusCode)) + } defer resp.Body.Close() return true, nil - }) + require.NoError(t, err, "Token propagation tmake est failed") + } func getESJaegerInstance() *v1.Jaeger {