diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2018-02-17 23:06:03 -0500 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2018-02-18 12:24:21 -0500 |
| commit | 2b39d24420f25dca6a3672f9795d78a063b868d9 (patch) | |
| tree | 3063ba72235d828c0bfa19587db067fc9916bee2 /test | |
| parent | 06004d5c5297acc7ca10a5a5d94c3b6cebc0e741 (diff) | |
Attempting to fix intermittent Integration Test failure
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'test')
| -rw-r--r-- | test/integration/awssvc/main.go | 6 | ||||
| -rw-r--r-- | test/integration/helper.bash | 3 | ||||
| -rw-r--r-- | test/integration/metasvc/main.go | 6 | ||||
| -rw-r--r-- | test/integration/mirrorsvc/main.go | 6 |
4 files changed, 18 insertions, 3 deletions
diff --git a/test/integration/awssvc/main.go b/test/integration/awssvc/main.go index c67a2a46..a377cd99 100644 --- a/test/integration/awssvc/main.go +++ b/test/integration/awssvc/main.go @@ -6,6 +6,7 @@ import ( "log" "net" "net/http" + "time" ) // Req - @@ -184,7 +185,10 @@ func ec2Handler(w http.ResponseWriter, r *http.Request) { func quitHandler(l net.Listener) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { - l.Close() w.WriteHeader(http.StatusNoContent) + go func() { + time.Sleep(500 * time.Millisecond) + l.Close() + }() } } diff --git a/test/integration/helper.bash b/test/integration/helper.bash index fbb019e9..39c30fe6 100644 --- a/test/integration/helper.bash +++ b/test/integration/helper.bash @@ -28,6 +28,7 @@ function __gomplate_stdin () { function start_mirror_svc () { bin/mirror & + wait_for_url http://127.0.0.1:8080/ } function stop_mirror_svc () { @@ -36,6 +37,7 @@ function stop_mirror_svc () { function start_meta_svc () { bin/meta &> /tmp/meta.log & + wait_for_url http://127.0.0.1:8081/ } function stop_meta_svc () { @@ -44,6 +46,7 @@ function stop_meta_svc () { function start_aws_svc () { bin/aws & + wait_for_url http://127.0.0.1:8082/ } function stop_aws_svc () { diff --git a/test/integration/metasvc/main.go b/test/integration/metasvc/main.go index 62bd1dda..2350736d 100644 --- a/test/integration/metasvc/main.go +++ b/test/integration/metasvc/main.go @@ -12,6 +12,7 @@ import ( "math/big" "net" "net/http" + "time" "github.com/fullsailor/pkcs7" ) @@ -137,7 +138,10 @@ func certificateHandler(w http.ResponseWriter, r *http.Request) { func quitHandler(l net.Listener) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { - l.Close() w.WriteHeader(http.StatusNoContent) + go func() { + time.Sleep(500 * time.Millisecond) + l.Close() + }() } } diff --git a/test/integration/mirrorsvc/main.go b/test/integration/mirrorsvc/main.go index 164ffc62..f05113a5 100644 --- a/test/integration/mirrorsvc/main.go +++ b/test/integration/mirrorsvc/main.go @@ -6,6 +6,7 @@ import ( "log" "net" "net/http" + "time" ) // Req - @@ -44,7 +45,10 @@ func rootHandler(w http.ResponseWriter, r *http.Request) { func quitHandler(l net.Listener) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { - l.Close() w.WriteHeader(http.StatusNoContent) + go func() { + time.Sleep(500 * time.Millisecond) + l.Close() + }() } } |
