@@ -31,9 +31,9 @@ import diagnostics_channel from "node:diagnostics_channel";
3131
3232import testUtils from "../../test-utils" ;
3333import { DiagnosticsEvent } from "../../client/enterprise-maintenance-manager" ;
34- import { FaultInjectorClient , ActionTrigger , ActionType , ActionRequest } from "@redis/test-utils/lib/fault-injector" ;
34+ import { FaultInjectorClient , ActionTrigger , ActionRequest } from "@redis/test-utils/lib/fault-injector" ;
3535import { REClusterTestOptions } from "@redis/test-utils" ;
36- import { blockCommand , filterTriggersByArgs } from "./test-scenario.util" ;
36+ import { blockCommand , newConnectionReceivedSmigraging , filterTriggersByArgs } from "./test-scenario.util" ;
3737
3838type TestOptions = REClusterTestOptions < { } , { } , { } , 3 , { } >
3939
@@ -167,9 +167,12 @@ const KEYS = [
167167 "should not have received any notifications yet"
168168 ) ;
169169
170+ const newConnReceivedSmigratingPromise = newConnectionReceivedSmigraging ( cluster ) ;
170171
171172 await faultInjectorClient . triggerAction ( ACTION , ACTION_OPTIONS ) ;
172173
174+ assert . ok ( await newConnReceivedSmigratingPromise , 'Did not receive SMIGRATING on new connection' ) ;
175+
173176 // Verify notifications were received
174177 const sMigratingEventCount = diagnosticEvents . filter (
175178 ( event ) => event . type === "SMIGRATING"
@@ -460,9 +463,13 @@ const KEYS = [
460463 "should not have received any notifications yet"
461464 ) ;
462465
466+ const newConnReceivedSmigratingPromise = newConnectionReceivedSmigraging ( cluster ) ;
467+
463468 // Trigger migration
464469 await faultInjectorClient . triggerAction ( ACTION , ACTION_OPTIONS ) ;
465470
471+ assert . ok ( await newConnReceivedSmigratingPromise , 'Did not receive SMIGRATING on new connection' ) ;
472+
466473 // Verify notifications were received
467474 const sMigratingEventCount = diagnosticEvents . filter (
468475 ( event ) => event . type === "SMIGRATING"
@@ -752,9 +759,15 @@ const KEYS = [
752759 "should not have received any notifications yet"
753760 ) ;
754761
762+
763+ const newConnReceivedSmigratingPromise = newConnectionReceivedSmigraging ( cluster ) ;
764+
755765 // Trigger migration
756766 await faultInjectorClient . triggerAction ( ACTION , ACTION_OPTIONS ) ;
757767
768+ assert . ok ( await newConnReceivedSmigratingPromise , 'Did not receive SMIGRATING on new connection' ) ;
769+
770+
758771 // Verify notifications were received
759772 const sMigratingEventCount = diagnosticEvents . filter (
760773 ( event ) => event . type === "SMIGRATING"
@@ -1044,9 +1057,13 @@ const KEYS = [
10441057 "should not have received any notifications yet"
10451058 ) ;
10461059
1060+ const newConnReceivedSmigratingPromise = newConnectionReceivedSmigraging ( cluster ) ;
1061+
10471062 // Trigger migration
10481063 await faultInjectorClient . triggerAction ( ACTION , ACTION_OPTIONS ) ;
10491064
1065+ assert . ok ( await newConnReceivedSmigratingPromise , 'Did not receive SMIGRATING on new connection' ) ;
1066+
10501067 // Verify notifications were received
10511068 const sMigratingEventCount = diagnosticEvents . filter (
10521069 ( event ) => event . type === "SMIGRATING"
0 commit comments