@@ -59,14 +59,14 @@ protected override async Task AfterAllAsync()
59
59
}
60
60
61
61
[ Fact ]
62
- public void Must_receive_Terminated_when_system_of_deserialized_ActorRef_is_not_running ( )
62
+ public async Task Must_receive_Terminated_when_system_of_deserialized_ActorRef_is_not_running ( )
63
63
{
64
64
var probe = CreateTestProbe ( ) ;
65
65
Sys . EventStream . Subscribe ( probe . Ref , typeof ( QuarantinedEvent ) ) ;
66
66
var rarp = RARP . For ( Sys ) . Provider ;
67
67
// pick an unused port (not going to use a socket address generator here; just a port not used by either actor system)
68
- int port = rarp . DefaultAddress . Port . Value ;
69
- while ( port == rarp . DefaultAddress . Port . Value || port == 2666 )
68
+ var port = rarp . DefaultAddress . Port ;
69
+ while ( port == rarp . DefaultAddress . Port || port == 2666 )
70
70
port = ThreadLocalRandom . Current . Next ( 1 , 65535 ) ;
71
71
// simulate de-serialized ActorRef
72
72
var @ref = rarp . ResolveActorRef ( $ "akka.tcp://OtherSystem@localhost:{ port } /user/foo/bar#1752527294") ;
@@ -83,17 +83,17 @@ public void Must_receive_Terminated_when_system_of_deserialized_ActorRef_is_not_
83
83
} ;
84
84
Sys . ActorOf ( Props . Create ( ( ) => new Act ( act ) ) . WithDeploy ( Deploy . Local ) ) ;
85
85
86
- ExpectMsg ( @ref , TimeSpan . FromSeconds ( 20 ) ) ;
86
+ await ExpectMsgAsync ( @ref , TimeSpan . FromSeconds ( 20 ) ) ;
87
87
// we don't expect real quarantine when the UID is unknown, i.e. QuarantinedEvent is not published
88
- probe . ExpectNoMsg ( TimeSpan . FromSeconds ( 3 ) ) ;
88
+ await probe . ExpectNoMsgAsync ( TimeSpan . FromSeconds ( 3 ) ) ;
89
89
// The following verifies that re-delivery of Watch message is stopped.
90
90
// It was observed as periodic logging of "address is now gated" when the gate was lifted.
91
91
Sys . EventStream . Subscribe ( probe . Ref , typeof ( Warning ) ) ;
92
- probe . ExpectNoMsg ( TimeSpan . FromSeconds ( rarp . RemoteSettings . RetryGateClosedFor . TotalSeconds * 2 ) ) ;
92
+ await probe . ExpectNoMsgAsync ( TimeSpan . FromSeconds ( rarp . RemoteSettings . RetryGateClosedFor . TotalSeconds * 2 ) ) ;
93
93
}
94
94
95
95
[ Fact ]
96
- public void Must_receive_terminated_when_watched_node_is_unknown_host ( )
96
+ public async Task Must_receive_terminated_when_watched_node_is_unknown_host ( )
97
97
{
98
98
var path = new RootActorPath ( new Address ( "akka.tcp" , Sys . Name , "unknownhost" , 2552 ) ) / "user" / "subject" ;
99
99
var rarp = RARP . For ( Sys ) . Provider ;
@@ -111,27 +111,27 @@ public void Must_receive_terminated_when_watched_node_is_unknown_host()
111
111
112
112
Sys . ActorOf ( Props . Create ( ( ) => new Act ( act ) ) . WithDeploy ( Deploy . Local ) , "observer2" ) ;
113
113
114
- ExpectMsg ( path , TimeSpan . FromSeconds ( 60 ) ) ;
114
+ await ExpectMsgAsync ( path , TimeSpan . FromSeconds ( 60 ) ) ;
115
115
}
116
116
117
117
[ Fact ]
118
- public void Must_receive_ActorIdentity_null_when_identified_node_is_unknown_host ( )
118
+ public async Task Must_receive_ActorIdentity_null_when_identified_node_is_unknown_host ( )
119
119
{
120
120
var path = new RootActorPath ( new Address ( "akka.tcp" , Sys . Name , "unknownhost2" , 2552 ) ) / "user" / "subject" ;
121
121
Sys . ActorSelection ( path ) . Tell ( new Identify ( path ) ) ;
122
- var identify = ExpectMsg < ActorIdentity > ( TimeSpan . FromSeconds ( 60 ) ) ;
122
+ var identify = await ExpectMsgAsync < ActorIdentity > ( TimeSpan . FromSeconds ( 60 ) ) ;
123
123
identify . Subject . ShouldBe ( null ) ;
124
124
identify . MessageId . ShouldBe ( path ) ;
125
125
}
126
126
127
127
[ Fact ]
128
- public void Must_quarantine_systems_after_unsuccessful_system_message_delivery_if_have_not_communicated_before ( )
128
+ public async Task Must_quarantine_systems_after_unsuccessful_system_message_delivery_if_have_not_communicated_before ( )
129
129
{
130
130
// Synthesize an ActorRef to a remote system this one has never talked to before.
131
131
// This forces ReliableDeliverySupervisor to start with unknown remote system UID.
132
132
var rarp = RARP . For ( Sys ) . Provider ;
133
- int port = rarp . DefaultAddress . Port . Value ;
134
- while ( port == rarp . DefaultAddress . Port . Value || port == 2666 )
133
+ var port = rarp . DefaultAddress . Port ;
134
+ while ( port == rarp . DefaultAddress . Port || port == 2666 )
135
135
port = ThreadLocalRandom . Current . Next ( 1 , 65535 ) ;
136
136
137
137
var extinctPath = new RootActorPath ( new Address ( "akka.tcp" , "extinct-system" , "localhost" , port ) ) / "user" / "noone" ;
@@ -143,9 +143,9 @@ public void Must_quarantine_systems_after_unsuccessful_system_message_delivery_i
143
143
probe . Watch ( extinctRef ) ;
144
144
probe . Unwatch ( extinctRef ) ;
145
145
146
- probe . ExpectNoMsg ( TimeSpan . FromSeconds ( 5 ) ) ;
146
+ await probe . ExpectNoMsgAsync ( TimeSpan . FromSeconds ( 5 ) ) ;
147
147
Sys . EventStream . Subscribe ( probe . Ref , typeof ( Warning ) ) ;
148
- probe . ExpectNoMsg ( TimeSpan . FromSeconds ( rarp . RemoteSettings . RetryGateClosedFor . TotalSeconds * 2 ) ) ;
148
+ await probe . ExpectNoMsgAsync ( TimeSpan . FromSeconds ( rarp . RemoteSettings . RetryGateClosedFor . TotalSeconds * 2 ) ) ;
149
149
}
150
150
}
151
151
}
0 commit comments