zulip/zerver/tests
Alex Vandiver d47637fa40 queue: Set a max consume timeout with SIGALRM.
SIGALRM is the simplest way to set a specific maximum duration that
queue workers can take to handle a specific message.  This only works
in non-threaded environments, however, as signal handlers are
per-process, not per-thread.

The MAX_CONSUME_SECONDS is set quite high, at 10s -- the longest
average worker consume time is embed_links, which hovers near 1s.
Since just knowing the recent mean does not give much information[1],
it is difficult to know how much variance is expected.  As such, we
set the threshold to be such that only events which are significant
outliers will be timed out.  This can be tuned downwards as more
statistics are gathered on the runtime of the workers.

The exception to this is DeferredWorker, which deals with quite-long
requests, and thus has no enforceable SLO.

[1] https://www.autodesk.com/research/publications/same-stats-different-graphs
2020-10-06 17:26:14 -07:00
..
fixtures markdown: Add data-code-lang attribute for locally echoed messages. 2020-09-18 17:12:26 -07:00
images emoji: Only resize custom emoji that need it. 2019-01-29 10:33:50 -08:00
__init__.py
test_alert_words.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_archive.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_attachments.py models: Change attachment.size to not be nullable. 2020-06-20 13:15:02 -07:00
test_audit_log.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_auth_backends.py tests: Add a dummy request to self.client.login(). 2020-09-25 16:24:18 -07:00
test_bots.py python: Simplify away various unnecessary lists and list comprehensions. 2020-09-02 11:15:41 -07:00
test_bulk_create.py populate_db: Add emoji reactions to development environment database. 2020-09-23 16:10:37 -07:00
test_cache.py test_cache: Use assertLogs to avoid spam in test-backend output. 2020-07-26 16:14:17 -07:00
test_camo.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_compatibility.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_create_video_call.py python: Use standard secrets module to generate random tokens. 2020-09-09 15:52:57 -07:00
test_custom_profile_data.py custom_profile_fields: Don't allow leading/trailing whitespaces. 2020-10-02 14:58:06 -07:00
test_data_types.py data_types: Generalize StringDictType. 2020-09-25 11:43:19 -07:00
test_decorators.py webhooks: Do not predicate on the "payload" key. 2020-09-22 15:11:48 -07:00
test_digest.py digest: Support digest of web public streams for guest users. 2020-09-25 16:11:04 -07:00
test_docs.py urls: Migrate re_path routes to path. 2020-09-12 14:29:26 -07:00
test_drafts.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_email_change.py emails: Add a custom header specifying the organization when possible. 2020-06-28 13:33:02 -07:00
test_email_log.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_email_mirror.py test_email_mirror: Refactor mock.path to assertLogs. 2020-09-12 10:59:36 -07:00
test_email_notifications.py test: Use variable instead of hard coded value. 2020-09-02 17:58:19 -07:00
test_embedded_bot_system.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_event_queue.py tornado: Move default production port to 9800. 2020-09-18 15:13:40 -07:00
test_event_system.py fetch_initial_state_data: Pass realm as independent parameter. 2020-09-23 12:06:54 -07:00
test_events.py realm: Add wildcard_mention_policy setting. 2020-10-01 12:18:03 -07:00
test_external.py test_external: Refactor mock.patch to assertLogs. 2020-09-12 10:53:56 -07:00
test_gitter_importer.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_hipchat_importer.py test_hipchat_importer: Fix a type: ignore issue. 2020-06-30 18:58:23 -07:00
test_home.py test_classes: Extract home view helpers for reuse. 2020-10-01 15:14:25 -07:00
test_hotspots.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_i18n.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_import_export.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_integrations.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_integrations_dev_panel.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_internet.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_legacy_subject.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_link_embed.py tests: Check JSON serializability of test data with mock_queue_publish. 2020-09-03 17:34:31 -07:00
test_logging_handlers.py tests: Add more tests around exception handling. 2020-09-03 17:34:31 -07:00
test_management_commands.py tests: Use real path when getting commands in TestCommandsCanStart. 2020-09-01 10:55:07 -07:00
test_markdown.py RealmFilterPattern: Mark converted content as AtomicString. 2020-09-22 15:10:38 -07:00
test_mattermost_importer.py python: Prefer kwargs form of dict.update. 2020-09-03 17:51:09 -07:00
test_message_dict.py docs: Capitalize Markdown consistently. 2020-08-11 10:23:06 -07:00
test_message_edit.py test_move_msgs: Rename variable for clarity. 2020-10-01 17:45:11 -07:00
test_message_edit_notifications.py tests: Check JSON serializability of test data with mock_queue_publish. 2020-09-03 17:34:31 -07:00
test_message_fetch.py mypy: Add StreamDict. 2020-09-29 16:49:10 -07:00
test_message_flags.py python: Rewrite dict() as {}. 2020-09-02 11:15:41 -07:00
test_message_send.py message: Call build_message_send_dict from check_message. 2020-09-29 17:18:04 -07:00
test_message_topics.py topic_history: Allow anonymous access in web-public streams. 2020-09-04 10:17:56 -07:00
test_messages.py tests: Move test_near_pm_message_url to test_message_fetch.py. 2020-07-08 14:00:05 -07:00
test_middleware.py refactor: Rename bugdown words to markdown in stats related functions. 2020-06-26 17:20:40 -07:00
test_migrations.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_mirror_users.py python: Rewrite dict() as {}. 2020-09-02 11:15:41 -07:00
test_muting.py mypy: Use tuples for muted_topics. 2020-06-24 15:01:57 -07:00
test_new_users.py python: Convert more percent formatting to Python 3.6 f-strings. 2020-06-14 23:27:22 -07:00
test_onboarding.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_openapi.py rest: Specify rest_dispatch handlers by function, not by string. 2020-09-22 10:46:28 -07:00
test_outgoing_webhook_interfaces.py python: Rewrite dict() as {}. 2020-09-02 11:15:41 -07:00
test_outgoing_webhook_system.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_populate_db.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_presence.py test_presence: Switch data setup from pointer to message flags. 2020-06-27 16:44:38 -07:00
test_push_notifications.py test_push_notifications: Refactor mock.patch to assertLogs. 2020-09-28 12:12:00 -07:00
test_queue.py queue: Only ACK drain_queue once it has completed work on the list. 2020-10-06 17:26:14 -07:00
test_queue_worker.py queue: Set a max consume timeout with SIGALRM. 2020-10-06 17:26:14 -07:00
test_rate_limiter.py python: Use standard secrets module to generate random tokens. 2020-09-09 15:52:57 -07:00
test_reactions.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_realm.py realm: Add wildcard_mention_policy setting. 2020-10-01 12:18:03 -07:00
test_realm_domains.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_realm_emoji.py urls: Migrate re_path routes to path. 2020-09-12 14:29:26 -07:00
test_realm_export.py upload: Strip leading slash from deleted S3 export paths. 2020-09-13 20:59:09 -07:00
test_realm_filters.py linkifiers: Allow tildes in target URLs. 2020-09-21 21:04:02 -07:00
test_redis_utils.py python: Use standard secrets module to generate random tokens. 2020-09-09 15:52:57 -07:00
test_report.py report: Allow anonymous queries to report (un)narrow times. 2020-09-11 16:57:27 -07:00
test_retention.py python: Pre-fix a few spots for better Black formatting. 2020-09-03 17:51:09 -07:00
test_service_bot_system.py test_service_bot_system: Refactor mock.patch with assertLogs. 2020-09-12 10:59:36 -07:00
test_sessions.py test_sessions: Use assertLogs to avoid spam in test-backend output. 2020-07-27 11:02:17 -07:00
test_settings.py tests: Add a dummy request to self.client.login(). 2020-09-25 16:24:18 -07:00
test_signup.py urls: Remove unused URL names and shorten others. 2020-09-22 10:46:28 -07:00
test_slack_importer.py python: Rewrite dict() as {}. 2020-09-02 11:15:41 -07:00
test_slack_message_conversion.py python: Pre-fix a few spots for better Black formatting. 2020-09-03 17:51:09 -07:00
test_soft_deactivation.py soft_deactivation: Fix typo in logging output. 2020-09-28 12:12:04 -07:00
test_subdomains.py tests: Make all tests inherit ZulipTestCase. 2020-07-01 10:48:12 -07:00
test_submessage.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
test_subs.py mypy: Add StreamDict. 2020-09-29 16:49:10 -07:00
test_templates.py docs: Capitalize Markdown consistently. 2020-08-11 10:23:06 -07:00
test_thumbnail.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_timestamp.py timestamp: Remove datetime_to_precise_timestamp for datetime.timestamp. 2020-07-31 22:10:14 -07:00
test_tornado.py tornado: Remove an unused port argument. 2020-09-18 15:13:40 -07:00
test_transfer.py tests: Add an explicit order_by to prevent flakes. 2020-08-18 11:15:35 -04:00
test_tutorial.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_type_debug.py tests: Make all tests inherit ZulipTestCase. 2020-07-01 10:48:12 -07:00
test_typing.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_upload.py upload: Strip leading slash from deleted S3 export paths. 2020-09-13 20:59:09 -07:00
test_urls.py auth: Render config error page on configuration error. 2020-09-25 16:16:17 -07:00
test_user_groups.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
test_user_status.py python: Rewrite dict() as {}. 2020-09-02 11:15:41 -07:00
test_users.py email: Fix race conditions with concurrent ScheduledEmail handling. 2020-09-09 15:59:01 -07:00
test_webhooks_common.py webhooks: Rename api_key_only_webhook_view to webhook_view. 2020-09-10 17:47:21 -07:00
test_widgets.py python: Rewrite dict() as {}. 2020-09-02 11:15:41 -07:00
test_zcommand.py settings: Add automatic theme detection feature. 2020-06-21 01:09:01 -07:00
test_zephyr.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00