@@ -69,13 +69,14 @@ def test_default_config(self):
6969
7070 self .assertEqual (config ._actor_idle_timeout , timedelta (seconds = 3600 ))
7171 self .assertEqual (config ._actor_scan_interval , timedelta (seconds = 30 ))
72- self .assertEqual (config ._drain_ongoing_call_timeout , timedelta ( seconds = 60 ) )
72+ self .assertIsNone (config ._drain_ongoing_call_timeout )
7373 self .assertEqual (config ._drain_rebalanced_actors , True )
7474 self .assertEqual (config ._reentrancy , None )
7575 self .assertEqual (config ._entities , set ())
7676 self .assertEqual (config ._entitiesConfig , [])
7777 self .assertNotIn ('reentrancy' , config .as_dict ().keys ())
7878 self .assertNotIn ('remindersStoragePartitions' , config .as_dict ().keys ())
79+ self .assertNotIn ('drainOngoingCallTimeout' , config .as_dict ().keys ())
7980 self .assertEqual (config .as_dict ()['entitiesConfig' ], [])
8081
8182 def test_default_config_with_reentrancy (self ):
@@ -84,7 +85,7 @@ def test_default_config_with_reentrancy(self):
8485
8586 self .assertEqual (config ._actor_idle_timeout , timedelta (seconds = 3600 ))
8687 self .assertEqual (config ._actor_scan_interval , timedelta (seconds = 30 ))
87- self .assertEqual (config ._drain_ongoing_call_timeout , timedelta ( seconds = 60 ) )
88+ self .assertIsNone (config ._drain_ongoing_call_timeout )
8889 self .assertEqual (config ._drain_rebalanced_actors , True )
8990 self .assertEqual (config ._reentrancy , reentrancyConfig )
9091 self .assertEqual (config ._entities , set ())
@@ -110,7 +111,8 @@ def test_config_with_actor_type_config(self):
110111 self .assertEqual (config ._actor_scan_interval , timedelta (seconds = 30 ))
111112
112113 d = config .as_dict ()
113- self .assertEqual (config ._drain_ongoing_call_timeout , timedelta (seconds = 60 ))
114+ self .assertIsNone (config ._drain_ongoing_call_timeout )
115+ self .assertNotIn ('drainOngoingCallTimeout' , d )
114116 self .assertEqual (d ['entitiesConfig' ][0 ]['entities' ], ['testactor1' ])
115117 self .assertEqual (d ['entitiesConfig' ][0 ]['actorScanInterval' ], timedelta (seconds = 10 ))
116118 self .assertEqual (d ['entitiesConfig' ][0 ]['reentrancy' ]['enabled' ], True )
@@ -130,7 +132,7 @@ def test_update_entities(self):
130132
131133 self .assertEqual (config ._actor_idle_timeout , timedelta (seconds = 3600 ))
132134 self .assertEqual (config ._actor_scan_interval , timedelta (seconds = 30 ))
133- self .assertEqual (config ._drain_ongoing_call_timeout , timedelta ( seconds = 60 ) )
135+ self .assertIsNone (config ._drain_ongoing_call_timeout )
134136 self .assertEqual (config ._drain_rebalanced_actors , True )
135137 self .assertEqual (config ._entities , {'actortype1' })
136138 self .assertEqual (config ._entitiesConfig , [])
@@ -141,7 +143,7 @@ def test_update_entities_two_types(self):
141143 config .update_entities (['actortype1' , 'actortype1' ])
142144 self .assertEqual (config ._actor_idle_timeout , timedelta (seconds = 3600 ))
143145 self .assertEqual (config ._actor_scan_interval , timedelta (seconds = 30 ))
144- self .assertEqual (config ._drain_ongoing_call_timeout , timedelta ( seconds = 60 ) )
146+ self .assertIsNone (config ._drain_ongoing_call_timeout )
145147 self .assertEqual (config ._drain_rebalanced_actors , True )
146148 self .assertEqual (config ._entities , {'actortype1' , 'actortype1' })
147149 self .assertEqual (config ._entitiesConfig , [])
@@ -164,12 +166,17 @@ def test_set_reminders_storage_partitions(self):
164166 config = ActorRuntimeConfig (reminders_storage_partitions = 12 )
165167 self .assertEqual (config ._actor_idle_timeout , timedelta (seconds = 3600 ))
166168 self .assertEqual (config ._actor_scan_interval , timedelta (seconds = 30 ))
167- self .assertEqual (config ._drain_ongoing_call_timeout , timedelta ( seconds = 60 ) )
169+ self .assertIsNone (config ._drain_ongoing_call_timeout )
168170 self .assertEqual (config ._drain_rebalanced_actors , True )
169171 self .assertNotIn ('reentrancy' , config .as_dict ().keys ())
170172 self .assertEqual (config ._reminders_storage_partitions , 12 )
171173 self .assertEqual (config .as_dict ()['remindersStoragePartitions' ], 12 )
172174
175+ def test_explicit_drain_ongoing_call_timeout (self ):
176+ config = ActorRuntimeConfig (drain_ongoing_call_timeout = timedelta (seconds = 10 ))
177+ self .assertEqual (config ._drain_ongoing_call_timeout , timedelta (seconds = 10 ))
178+ self .assertEqual (config .as_dict ()['drainOngoingCallTimeout' ], timedelta (seconds = 10 ))
179+
173180
174181if __name__ == '__main__' :
175182 unittest .main ()
0 commit comments