diff --git a/worker_test.go b/worker_test.go
index <HASH>..<HASH> 100644
--- a/worker_test.go
+++ b/worker_test.go
@@ -161,22 +161,23 @@ func Test_Echo_Slow(t *testing.T) {
 func Test_Broken(t *testing.T) {
 	cmd := exec.Command("php", "tests/client.php", "broken", "pipes")
 
-	w, _ := NewPipeFactory().SpawnWorker(cmd)
+	w, err := NewPipeFactory().SpawnWorker(cmd)
+	if err != nil {
+		t.Fatal(err)
+	}
+
 	go func() {
 		err := w.Wait()
 		assert.Error(t, err)
 		assert.Contains(t, err.Error(), "undefined_function()")
 	}()
-
-	defer func() {
-		time.Sleep(time.Second)
-		err := w.Stop()
-		assert.NoError(t, err)
-	}()
-
+	
 	res, err := w.Exec(&Payload{Body: []byte("hello")})
 	assert.Nil(t, res)
 	assert.NotNil(t, err)
+
+	time.Sleep(time.Second)
+	assert.NoError(t, w.Stop())
 }
 
 func Test_OnStarted(t *testing.T) {
Remove defer from Test_Broken test (put statement at the end of the
func)