Eventually(created).Should(Receive()) err := apiClient.Ping() Ω(err).Should(HaveOccurred()) }) }) Context("when a Run request is in-flight", func() { It("does not wait for the request to complete", func(done Done) { fakeContainer := new(fakes.FakeContainer) fakeContainer.RunStub = func(spec garden.ProcessSpec, io garden.ProcessIO) (garden.Process, error) { process := new(fakes.FakeProcess) process.WaitStub = func() (int, error) { time.Sleep(time.Minute) return 0, nil } go func() { defer GinkgoRecover() _, err := io.Stdout.Write([]byte("msg 1\n")) Ω(err).ShouldNot(HaveOccurred()) time.Sleep(time.Minute) _, err = io.Stdout.Write([]byte("msg 2\n")) Ω(err).ShouldNot(HaveOccurred()) }() return process, nil