예제 #1
0
 def test_set_reminders_storage_partitions(self):
     config = ActorRuntimeConfig(reminders_storage_partitions=12)
     self.assertEqual(config._actor_idle_timeout, timedelta(seconds=3600))
     self.assertEqual(config._actor_scan_interval, timedelta(seconds=30))
     self.assertEqual(config._drain_ongoing_call_timeout, timedelta(seconds=60))
     self.assertEqual(config._drain_rebalanced_actors, True)
     self.assertNotIn('reentrancy', config.as_dict().keys())
     self.assertEqual(config._reminders_storage_partitions, 12)
     self.assertEqual(config.as_dict()['remindersStoragePartitions'], 12)
예제 #2
0
    def test_default_config(self):
        config = ActorRuntimeConfig()

        self.assertEqual(config._actor_idle_timeout, timedelta(seconds=3600))
        self.assertEqual(config._actor_scan_interval, timedelta(seconds=30))
        self.assertEqual(config._drain_ongoing_call_timeout, timedelta(seconds=60))
        self.assertEqual(config._drain_rebalanced_actors, True)
        self.assertEqual(config._reentrancy, None)
        self.assertEqual(config._entities, [])
        self.assertNotIn('reentrancy', config.as_dict().keys())
        self.assertNotIn('remindersStoragePartitions', config.as_dict().keys())
예제 #3
0
    def test_default_config_with_reentrancy(self):
        reentrancyConfig = ActorReentrancyConfig(enabled=True)
        config = ActorRuntimeConfig(reentrancy=reentrancyConfig)

        self.assertEqual(config._actor_idle_timeout, timedelta(seconds=3600))
        self.assertEqual(config._actor_scan_interval, timedelta(seconds=30))
        self.assertEqual(config._drain_ongoing_call_timeout, timedelta(seconds=60))
        self.assertEqual(config._drain_rebalanced_actors, True)
        self.assertEqual(config._reentrancy, reentrancyConfig)
        self.assertEqual(config._entities, [])
        self.assertEqual(config.as_dict()['reentrancy'], reentrancyConfig.as_dict())
        self.assertEqual(config.as_dict()['reentrancy']['enabled'], True)
        self.assertEqual(config.as_dict()['reentrancy']['maxStackDepth'], 32)
        self.assertNotIn('remindersStoragePartitions', config.as_dict().keys())
예제 #4
0
 def test_update_entities_two_types(self):
     config = ActorRuntimeConfig()
     config.update_entities(['actortype1', 'actortype1'])
     self.assertEqual(config._actor_idle_timeout, timedelta(seconds=3600))
     self.assertEqual(config._actor_scan_interval, timedelta(seconds=30))
     self.assertEqual(config._drain_ongoing_call_timeout, timedelta(seconds=60))
     self.assertEqual(config._drain_rebalanced_actors, True)
     self.assertEqual(config._entities, ['actortype1', 'actortype1'])
     self.assertNotIn('remindersStoragePartitions', config.as_dict().keys())