@@ -282,7 +282,7 @@ func TestInstanceOperator_checkWorkers(t *testing.T) {
282282 }{
283283 {
284284 name : "Test 1: Successful reload" ,
285- expectedLog : "All NGINX workers have been reloaded" ,
285+ expectedLog : "NGINX workers have been reloaded" ,
286286 reloadTime : time .Date (2025 , 8 , 13 , 8 , 0 , 0 , 0 , time .Local ),
287287 instanceID : "e1374cb1-462d-3b6c-9f3b-f28332b5f10c" ,
288288 workers : []* nginxprocess.Process {
@@ -315,7 +315,41 @@ func TestInstanceOperator_checkWorkers(t *testing.T) {
315315 },
316316 },
317317 {
318- name : "Test 2: Unsuccessful reload" ,
318+ name : "Test 2: Successful reload - one workers is reloaded" ,
319+ expectedLog : "NGINX workers have been reloaded" ,
320+ reloadTime : time .Date (2025 , 8 , 13 , 8 , 0 , 0 , 0 , time .Local ),
321+ instanceID : "e1374cb1-462d-3b6c-9f3b-f28332b5f10c" ,
322+ masterProcess : []* nginxprocess.Process {
323+ {
324+ PID : 1234 ,
325+ Created : time .Date (2025 , 8 , 13 , 8 , 1 , 0 , 0 , time .Local ),
326+ PPID : 1 ,
327+ Name : "nginx" ,
328+ Cmd : "nginx: master process /usr/local/opt/nginx/bin/nginx -g daemon off;" ,
329+ Exe : exePath ,
330+ },
331+ },
332+ workers : []* nginxprocess.Process {
333+ {
334+ PID : 567 ,
335+ Created : time .Date (2025 , 8 , 13 , 8 , 1 , 0 , 0 , time .Local ),
336+ PPID : 1234 ,
337+ Name : "nginx" ,
338+ Cmd : "nginx: worker process" ,
339+ Exe : exePath ,
340+ },
341+ {
342+ PID : 789 ,
343+ PPID : 1234 ,
344+ Created : time .Date (2025 , 8 , 13 , 7 , 1 , 0 , 0 , time .Local ),
345+ Name : "nginx" ,
346+ Cmd : "nginx: worker process" ,
347+ Exe : exePath ,
348+ },
349+ },
350+ },
351+ {
352+ name : "Test 3: Unsuccessful reload" ,
319353 expectedLog : "\" Failed to check if NGINX worker processes have successfully reloaded, timed out " +
320354 "waiting\" error=\" waiting for NGINX worker processes\" " ,
321355 reloadTime : time .Date (2025 , 8 , 13 , 8 , 0 , 0 , 0 , time .Local ),
@@ -333,7 +367,7 @@ func TestInstanceOperator_checkWorkers(t *testing.T) {
333367 workers : []* nginxprocess.Process {
334368 {
335369 PID : 567 ,
336- Created : time .Date (2025 , 8 , 13 , 8 , 1 , 0 , 0 , time .Local ),
370+ Created : time .Date (2025 , 8 , 13 , 7 , 1 , 0 , 0 , time .Local ),
337371 PPID : 1234 ,
338372 Name : "nginx" ,
339373 Cmd : "nginx: worker process" ,
0 commit comments