zulip/zerver/tests
Anders Kaseorg ea6934c26d dependencies: Remove WebSockets system for sending messages.
Zulip has had a small use of WebSockets (specifically, for the code
path of sending messages, via the webapp only) since ~2013.  We
originally added this use of WebSockets in the hope that the latency
benefits of doing so would allow us to avoid implementing a markdown
local echo; they were not.  Further, HTTP/2 may have eliminated the
latency difference we hoped to exploit by using WebSockets in any
case.

While we’d originally imagined using WebSockets for other endpoints,
there was never a good justification for moving more components to the
WebSockets system.

This WebSockets code path had a lot of downsides/complexity,
including:

* The messy hack involving constructing an emulated request object to
  hook into doing Django requests.
* The `message_senders` queue processor system, which increases RAM
  needs and must be provisioned independently from the rest of the
  server).
* A duplicate check_send_receive_time Nagios test specific to
  WebSockets.
* The requirement for users to have their firewalls/NATs allow
  WebSocket connections, and a setting to disable them for networks
  where WebSockets don’t work.
* Dependencies on the SockJS family of libraries, which has at times
  been poorly maintained, and periodically throws random JavaScript
  exceptions in our production environments without a deep enough
  traceback to effectively investigate.
* A total of about 1600 lines of our code related to the feature.
* Increased load on the Tornado system, especially around a Zulip
  server restart, and especially for large installations like
  zulipchat.com, resulting in extra delay before messages can be sent
  again.

As detailed in
https://github.com/zulip/zulip/pull/12862#issuecomment-536152397, it
appears that removing WebSockets moderately increases the time it
takes for the `send_message` API query to return from the server, but
does not significantly change the time between when a message is sent
and when it is received by clients.  We don’t understand the reason
for that change (suggesting the possibility of a measurement error),
and even if it is a real change, we consider that potential small
latency regression to be acceptable.

If we later want WebSockets, we’ll likely want to just use Django
Channels.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-01-14 22:34:00 -08:00
..
fixtures bugdown: Reenable -,+ to begin a markdown list. 2019-12-09 16:13:02 -08:00
images emoji: Only resize custom emoji that need it. 2019-01-29 10:33:50 -08:00
__init__.py
test_alert_words.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_archive.py
test_attachments.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_audit_log.py billing: Sync realm activation events for on-prem billing. 2019-10-08 17:18:30 -07:00
test_auth_backends.py invitations: Improve experience around reactivating users. 2020-01-13 18:30:51 -08:00
test_bots.py users: Refactor get_members_backend endpoint to use get_raw_user_data. 2019-10-23 14:50:26 -07:00
test_bugdown.py markdown: Remove redundant checks from /me. 2019-12-03 17:17:10 -08:00
test_cache.py cache: Validate keys before passing them to memcached. 2020-01-03 16:56:42 -08:00
test_camo.py camo: Add endpoint to handle camo requests. 2019-01-04 10:27:04 -08:00
test_compatibility.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
test_create_video_call.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_custom_profile_data.py events: Only send bot_type for bots and thus remove the for_api param. 2019-10-29 15:41:35 -07:00
test_decorators.py api: Return a JsonableError if API key of invalid format is given. 2020-01-03 16:56:42 -08:00
test_digest.py models: Migration of Message.pub_date to date_sent, part 2. 2019-10-05 19:01:34 -07:00
test_docs.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_email_change.py urls: Tighten many unintentionally broad URL patterns. 2019-08-26 20:51:49 -07:00
test_email_log.py emails: Don't log emails while running test suite. 2018-10-11 15:12:08 -07:00
test_email_mirror.py email_mirror: Use .walk() to search all MIME parts for attachments. 2020-01-14 15:37:39 -08:00
test_email_notifications.py email_mirror: Migrate missed message addresses from redis to database. 2020-01-07 13:03:22 -08:00
test_embedded_bot_system.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_event_queue.py notifications: Enable online push notifications by default. 2019-12-12 13:04:10 -08:00
test_events.py realm: Add private_message_policy setting. 2020-01-13 12:20:42 -08:00
test_external.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_feedback.py
test_gitter_importer.py tests: Move get_set to ZulipTestCase. 2019-05-21 14:10:29 -07:00
test_hipchat_importer.py hipchat: Limit messages in slim mode. 2018-11-26 16:37:30 -08:00
test_home.py dependencies: Remove WebSockets system for sending messages. 2020-01-14 22:34:00 -08:00
test_hotspots.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_i18n.py tests: tearDown overrides should call super().tearDown(). 2019-10-18 13:36:59 -07:00
test_import_export.py models: Add recipient foreign key in UserProfile and Stream. 2019-12-09 15:14:41 -08:00
test_integrations_dev_panel.py request: Tighten type checking on REQ. 2019-11-13 12:35:55 -08:00
test_legacy_subject.py Add alias support to REQ helpers for subject/topic. 2018-11-12 15:47:11 -08:00
test_link_embed.py url_preview: Fix parsing of open graph tags. 2019-12-12 15:24:38 -08:00
test_logging_handlers.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_management_commands.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_mattermost_importer.py test_mattermost_importer: Fix leftover references to message.pub_date. 2019-10-11 04:07:12 +02:00
test_message_edit_notifications.py notifications: Enable online push notifications by default. 2019-12-12 13:04:10 -08:00
test_messages.py realm: Add private_message_policy setting. 2020-01-13 12:20:42 -08:00
test_middleware.py open graph: Uploaded realm icon URL is absolute for some backends. 2019-05-20 13:14:28 -07:00
test_migrations.py test_migrations: Disable migrations test. 2019-05-12 22:06:17 -07:00
test_muting.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_narrow.py api: Remove legacy emoji reactions endpoint. 2019-11-12 13:07:06 -08:00
test_new_users.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_onboarding.py
test_openapi.py openapi: Specify securityScheme for the API in root level. 2019-12-06 11:19:08 -08:00
test_outgoing_webhook_interfaces.py tests: Improve outgoing webhook testing strategy. 2019-11-05 11:49:00 -08:00
test_outgoing_webhook_system.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_populate_db.py models: Migration of Message.pub_date to date_sent, part 2. 2019-10-05 19:01:34 -07:00
test_presence.py notifications: Ignore mobile presence when sending notifications. 2019-12-11 16:05:35 -08:00
test_push_notifications.py push_notifs: Improve handling of errors when talking to the bouncer. 2019-12-04 09:58:22 -08:00
test_queue.py Upgrade pika to 1.1.*. 2019-10-29 17:01:12 -07:00
test_queue_worker.py queue: Take advantage of ABC for defining abstract worker base classes. 2019-12-28 10:52:17 -08:00
test_reactions.py api: Remove legacy emoji reactions endpoint. 2019-11-12 13:07:06 -08:00
test_realm.py realm: Add private_message_policy setting. 2020-01-13 12:20:42 -08:00
test_realm_domains.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_realm_emoji.py get_realm: raise DoesNotExist instead of returning None. 2019-05-06 21:58:16 -07:00
test_realm_export.py billing: Change RealmAuditLog.event_type from str to int. 2019-10-06 15:55:56 -07:00
test_realm_filters.py linkifiers: Allow semicolons in target URLs. 2019-05-14 11:17:55 -07:00
test_report.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_retention.py bugdown: Fix logic for extracting attachment path_id. 2019-12-12 20:30:26 -08:00
test_service_bot_system.py mypy: Upgrade from 0.720 to 0.730. 2019-11-13 12:38:45 -08:00
test_sessions.py zerver/tests: Remove unused imports. 2019-02-02 17:43:03 -08:00
test_settings.py auth: Use zxcvbn to ensure password strength on server side. 2019-11-21 10:23:37 -08:00
test_signup.py recipients: Remove bulk_get_recipients function and its uses. 2019-12-12 12:00:13 -08:00
test_slack_importer.py slack import: Map Slack guest users to Zulip guests. 2019-11-12 12:12:59 -08:00
test_slack_message_conversion.py test_slack_message_conversion: Use subTest for fixtures test. 2019-09-13 11:54:14 -07:00
test_soft_deactivation.py soft-deactivation: Run catch-up when "auto" deactivate is run. 2019-03-14 11:53:15 -07:00
test_subdomains.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
test_submessage.py events: Pass a realm object into send_event. 2018-11-02 16:47:39 -07:00
test_subs.py stream_recipient: Eliminate unnecessary queries. 2020-01-08 14:34:43 -08:00
test_templates.py support: Pass various realm functions as template context. 2019-10-21 16:52:46 -07:00
test_thumbnail.py CVE-2019-19775: Close open redirect in thumbnail view. 2019-12-12 17:29:20 -08:00
test_timestamp.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
test_tornado.py dependencies: Remove WebSockets system for sending messages. 2020-01-14 22:34:00 -08:00
test_transfer.py management: Add tooling for transfering local uploads to s3. 2019-02-14 14:31:46 -08:00
test_tutorial.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_type_debug.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
test_typing.py test_typing: Prepare for moving system bots to zulipinternal. 2019-07-20 14:55:21 -07:00
test_unread.py tests: setUp overrides should call super().setUp(). 2019-10-19 17:27:01 -07:00
test_upload.py bugdown: Fix logic for extracting attachment path_id. 2019-12-12 20:30:26 -08:00
test_urls.py urls: Tighten many unintentionally broad URL patterns. 2019-08-26 20:51:49 -07:00
test_user_groups.py settings: Add setting for who can edit user groups. 2019-11-03 16:45:13 -08:00
test_user_status.py user status: Add "status_text" support in the backend. 2019-01-24 09:46:35 -08:00
test_users.py notifications: Enable online push notifications by default. 2019-12-12 13:04:10 -08:00
test_webhooks_common.py webhooks: Eliminate the usage of a headers.py file. 2019-06-26 10:35:14 -07:00
test_widgets.py widgets: Remove ALLOW_SUB_MESSAGES flag and enable widgets by default. 2019-01-29 09:34:14 -08:00
test_zcommand.py
test_zephyr.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00