Make Stop() wait for the processes to exit

This commit is contained in:
Gareth Smith 2017-11-24 09:20:56 +00:00
parent 0dfe20ef49
commit 8a92d310ba
4 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ func (s *APIServer) Start(etcdURL string) error {
// Stop stops this process gracefully. // Stop stops this process gracefully.
func (s *APIServer) Stop() { func (s *APIServer) Stop() {
if s.session != nil { if s.session != nil {
s.session.Terminate() s.session.Terminate().Wait()
} }
} }

View File

@ -26,7 +26,7 @@ var _ = Describe("Apiserver", func() {
By("Stopping the API Server") By("Stopping the API Server")
apiServer.Stop() apiServer.Stop()
Eventually(apiServer).Should(gexec.Exit(143)) Expect(apiServer).To(gexec.Exit(143))
}) })
}) })

View File

@ -36,7 +36,7 @@ func (e *Etcd) Start(etcdURL string, datadir string) error {
// Stop stops this process gracefully. // Stop stops this process gracefully.
func (e *Etcd) Stop() { func (e *Etcd) Stop() {
if e.session != nil { if e.session != nil {
e.session.Terminate() e.session.Terminate().Wait()
} }
} }

View File

@ -26,7 +26,7 @@ var _ = Describe("Etcd", func() {
By("Stopping the Etcd Server") By("Stopping the Etcd Server")
etcd.Stop() etcd.Stop()
Eventually(etcd).Should(gexec.Exit(143)) Expect(etcd).To(gexec.Exit(143))
}) })
}) })