@@ -35,11 +35,11 @@ func TestRunCommand_ConfigValidation(t *testing.T) {
3535 output := stdoutBuf .String () + stderrBuf .String ()
3636
3737 if exitCode != tt .expectedExit {
38- t .Errorf ("Expected exit code %d, got %d" , tt .expectedExit , exitCode )
38+ t .Fatalf ("Expected exit code %d, got %d" , tt .expectedExit , exitCode )
3939 }
4040
4141 if ! strings .Contains (output , tt .errorMessage ) {
42- t .Errorf ("Expected error message %q, got %q" , tt .errorMessage , output )
42+ t .Fatalf ("Expected error message %q, got %q" , tt .errorMessage , output )
4343 }
4444 })
4545 }
@@ -97,7 +97,7 @@ func TestRunCommand_Foreground(t *testing.T) {
9797
9898 err = cmd .Start ()
9999 if err != nil {
100- t .Errorf ("error starting in foreground: %s" , err .Error ())
100+ t .Fatalf ("error starting in foreground: %s" , err .Error ())
101101 }
102102
103103 // Start goroutines to read from pipes and populate buffers
@@ -129,13 +129,13 @@ func TestRunCommand_Foreground(t *testing.T) {
129129 if err != nil && ! strings .Contains (err .Error (), "signal" ) &&
130130 ! strings .Contains (err .Error (), "interrupt" ) &&
131131 ! strings .Contains (err .Error (), "context deadline" ) {
132- t .Errorf ("Unexpected error (ignoring interrupt/timeout): %v" , err )
132+ t .Fatalf ("Unexpected error (ignoring interrupt/timeout): %v" , err )
133133 }
134134
135135 output := stdout .String () + stderr .String ()
136136 expected := "Started meeseeks program_count=1"
137137 if ! strings .Contains (output , expected ) {
138- t .Errorf ("Expected output to contain %q, got %q" , expected , output )
138+ t .Fatalf ("Expected output to contain %q, got %q" , expected , output )
139139 }
140140}
141141
@@ -179,17 +179,17 @@ func TestRunCommand_Detached(t *testing.T) {
179179
180180 output := stdout .String () + stderr .String ()
181181 if ! strings .Contains (output , "Started meeseeks (detached)" ) {
182- t .Errorf ("Expected `Started meeseeks (detached)`, got: %q" , output )
182+ t .Fatalf ("Expected `Started meeseeks (detached)`, got: %q" , output )
183183 }
184184
185185 if _ , err := os .Stat (expectedPidFile ); os .IsNotExist (err ) {
186- t .Errorf ("PID file was not created at %s" , expectedPidFile )
186+ t .Fatalf ("PID file was not created at %s" , expectedPidFile )
187187 }
188188
189189 time .Sleep (500 * time .Millisecond )
190190
191191 if _ , err := os .Stat (expectedSocketPath ); os .IsNotExist (err ) {
192- t .Errorf ("Socket file was not created at %s" , expectedSocketPath )
192+ t .Fatalf ("Socket file was not created at %s" , expectedSocketPath )
193193 }
194194
195195 var stdoutBuf , stderrBuf bytes.Buffer
@@ -201,25 +201,25 @@ func TestRunCommand_Detached(t *testing.T) {
201201 5 * time .Second ,
202202 )
203203 if exitCode != 0 {
204- t .Errorf ("Expected exit code %d, got %d" , 0 , exitCode )
204+ t .Fatalf ("Expected exit code %d, got %d" , 0 , exitCode )
205205 }
206206 statusOutput := stdoutBuf .String () + stderrBuf .String ()
207207
208208 if strings .Contains (statusOutput , "meeseeks server not running" ) {
209- t .Errorf ("Status command could not connect to daemon: %q" , statusOutput )
209+ t .Fatalf ("Status command could not connect to daemon: %q" , statusOutput )
210210 }
211211
212212 exitCode = runCLICommand (t , []string {"exit" }, nil , nil , 5 * time .Second )
213213 if exitCode != 0 {
214- t .Errorf ("Expected exit code %d, got %d" , 0 , exitCode )
214+ t .Fatalf ("Expected exit code %d, got %d" , 0 , exitCode )
215215 }
216216
217217 if _ , err := os .Stat (expectedPidFile ); ! os .IsNotExist (err ) {
218- t .Error ("PID file still exists. Stoping meeseeks should remove the PID file" )
218+ t .Fatal ("PID file still exists. Stoping meeseeks should remove the PID file" )
219219 }
220220
221221 if _ , err := os .Stat (expectedSocketPath ); ! os .IsNotExist (err ) {
222- t .Error ("Socket file still exists. Stoping meeseeks should remove the Socket file" )
222+ t .Fatal ("Socket file still exists. Stoping meeseeks should remove the Socket file" )
223223 }
224224
225225 var stdoutBuf2 , stderrBuf2 bytes.Buffer
@@ -231,11 +231,11 @@ func TestRunCommand_Detached(t *testing.T) {
231231 5 * time .Second ,
232232 )
233233 if exitCode != 1 {
234- t .Errorf ("Expected exit code %d, got %d" , 1 , exitCode )
234+ t .Fatalf ("Expected exit code %d, got %d" , 1 , exitCode )
235235 }
236236 statusOutput = stdoutBuf2 .String () + stderrBuf2 .String ()
237237
238238 if ! strings .Contains (statusOutput , "meeseeks server not running" ) {
239- t .Error ("Status command should not work after exiting meeseeks" )
239+ t .Fatal ("Status command should not work after exiting meeseeks" )
240240 }
241241}
0 commit comments