mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	tornado: Track which queues were inherited from old Tornado instances.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							fc41d6085b
						
					
				
				
					commit
					1d3813ec4f
				
			@@ -251,6 +251,7 @@ from zerver.tornado.event_queue import (
 | 
			
		||||
    allocate_client_descriptor,
 | 
			
		||||
    clear_client_event_queues_for_testing,
 | 
			
		||||
    create_heartbeat_event,
 | 
			
		||||
    mark_clients_to_reload,
 | 
			
		||||
    send_web_reload_client_events,
 | 
			
		||||
)
 | 
			
		||||
from zerver.views.realm_playgrounds import access_playground_by_id
 | 
			
		||||
@@ -288,6 +289,7 @@ class BaseAction(ZulipTestCase):
 | 
			
		||||
        pronouns_field_type_supported: bool = True,
 | 
			
		||||
        linkifier_url_template: bool = True,
 | 
			
		||||
        user_list_incomplete: bool = False,
 | 
			
		||||
        client_is_old: bool = False,
 | 
			
		||||
    ) -> List[Dict[str, Any]]:
 | 
			
		||||
        """
 | 
			
		||||
        Make sure we have a clean slate of client descriptors for these tests.
 | 
			
		||||
@@ -336,6 +338,9 @@ class BaseAction(ZulipTestCase):
 | 
			
		||||
            user_list_incomplete=user_list_incomplete,
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        if client_is_old:
 | 
			
		||||
            mark_clients_to_reload([client.event_queue.id])
 | 
			
		||||
 | 
			
		||||
        # We want even those `send_event` calls which have been hooked to
 | 
			
		||||
        # `transaction.on_commit` to execute in tests.
 | 
			
		||||
        # See the comment in `ZulipTestCase.capture_send_event_calls`.
 | 
			
		||||
@@ -3457,8 +3462,14 @@ class NormalActionsTest(BaseAction):
 | 
			
		||||
        check_has_zoom_token("events[0]", events[0], value=False)
 | 
			
		||||
 | 
			
		||||
    def test_web_reload_client_event(self) -> None:
 | 
			
		||||
        self.verify_action(
 | 
			
		||||
            lambda: send_web_reload_client_events(),
 | 
			
		||||
            client_is_old=False,
 | 
			
		||||
            num_events=0,
 | 
			
		||||
            state_change_expected=False,
 | 
			
		||||
        )
 | 
			
		||||
        with self.assertRaises(WebReloadClientError):
 | 
			
		||||
            self.verify_action(lambda: send_web_reload_client_events())
 | 
			
		||||
            self.verify_action(lambda: send_web_reload_client_events(), client_is_old=True)
 | 
			
		||||
 | 
			
		||||
    def test_display_setting_event_not_sent(self) -> None:
 | 
			
		||||
        events = self.verify_action(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user