@@ -299,6 +299,13 @@ func TestPushNotifications(t *testing.T) {
299299 // Trigger bind action to complete the migration process (or inject MOVING in proxy mock mode)
300300 var bindResp * ActionResponse
301301 if testMode .IsProxyMock () {
302+ // Proxy mock: Start commands BEFORE injecting MOVING notification
303+ // This ensures there are active connections that can receive the push notification
304+ p ("Starting commands before MOVING injection (proxy mock mode)..." )
305+ go commandsRunner .FireCommandsUntilStop (ctx )
306+ // Give commands time to establish connections
307+ time .Sleep (1 * time .Second )
308+
302309 // Proxy mock: Directly inject MOVING notification
303310 // Format: ["MOVING", seqID, timeS, endpoint]
304311 // timeS is the time in seconds until the connection should be handed off
@@ -472,13 +479,13 @@ func TestPushNotifications(t *testing.T) {
472479 // Run commands based on mode
473480 if testMode .SkipMultiClientTests {
474481 // Single client mode (proxy mock)
482+ // Commands are already running (started before MOVING injection)
475483 // Need to wait long enough for:
476484 // 1. MOVING notification to be processed
477485 // 2. Handoff to be scheduled (at timeS/2 = 15 seconds)
478486 // 3. Handoff to execute
479487 // 4. Post-handoff relaxed timeout to be observed (2 seconds)
480488 // Total: ~20 seconds minimum
481- go commandsRunner .FireCommandsUntilStop (ctx )
482489 time .Sleep (25 * time .Second )
483490 commandsRunner .Stop ()
484491 } else {
0 commit comments