Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zmq: speed up tests #9875

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

zmq: speed up tests #9875

wants to merge 4 commits into from

Conversation

xjules
Copy link
Contributor

@xjules xjules commented Jan 25, 2025

Issue
Speed up tests by:

  • 2 seconds in monitor tests
  • 12 seconds in the evaluator tests

The list of 30 slowest in in ensemble evaluator after this PR

=================================================================== slowest 30 durations ====================================================================
2.04s call     tests/ert/unit_tests/ensemble_evaluator/test_scheduler.py::test_scheduler_receives_checksum_and_waits_for_disk_sync
1.20s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_client.py::test_retry
1.20s call     tests/ert/unit_tests/ensemble_evaluator/test_monitor.py::test_unexpected_close_after_connection_successful
1.02s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_legacy.py::test_run_and_cancel_legacy_ensemble
1.02s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_legacy.py::test_run_legacy_ensemble
1.01s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_new_monitor_can_pick_up_where_we_left_off
1.01s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_restarted_jobs_do_not_have_error_msgs
0.51s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_ensure_multi_level_events_in_order
0.51s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_monitor_receive_heartbeats
0.51s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_when_task_prematurely_ends_raises_exception[_publisher-publisher_task]
0.51s call     tests/ert/unit_tests/ensemble_evaluator/test_monitor.py::test_that_monitor_cannot_connect_with_wrong_server_key[False]
0.51s teardown tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_new_connections_are_no_problem_when_evaluator_is_closing_down
0.50s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_when_task_prematurely_ends_raises_exception[_process_event_buffer-processing_task]
0.50s teardown tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_restarted_jobs_do_not_have_error_msgs
0.50s teardown tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_monitor_receive_heartbeats
0.50s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_when_task_prematurely_ends_raises_exception[_batch_events_into_buffer-dispatcher_task]
0.50s teardown tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_new_monitor_can_pick_up_where_we_left_off
0.31s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_dispatch_endpoint_clients_can_connect_and_monitor_can_shut_down_evaluator
0.25s call     tests/ert/unit_tests/ensemble_evaluator/test_monitor.py::test_that_monitor_track_can_exit_without_terminated_event_from_evaluator
0.24s call     tests/ert/unit_tests/ensemble_evaluator/test_async_queue_execution.py::test_happy_path
0.23s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_client.py::test_reconnect_when_missing_heartbeat
0.19s call     tests/ert/unit_tests/ensemble_evaluator/test_monitor.py::test_that_monitor_cannot_connect_with_wrong_server_key[True]
0.15s call     tests/ert/unit_tests/ensemble_evaluator/test_monitor.py::test_immediate_stop
0.14s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_client.py::test_successful_sending
0.13s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_evaluator.py::test_overspent_cpu_is_logged
0.12s call     tests/ert/unit_tests/ensemble_evaluator/test_monitor.py::test_that_monitor_can_emit_heartbeats
0.12s call     tests/ert/unit_tests/ensemble_evaluator/test_monitor.py::test_monitor_connects_and_disconnects_successfully
0.10s call     tests/ert/unit_tests/ensemble_evaluator/test_monitor.py::test_no_connection_established
0.03s setup    tests/ert/unit_tests/ensemble_evaluator/test_ensemble_legacy.py::test_queue_config_properties_propagated_to_scheduler
0.01s call     tests/ert/unit_tests/ensemble_evaluator/test_ensemble_legacy.py::test_queue_config_properties_propagated_to_scheduler
==================================================================== 54 passed in 15.99s ====================================================================

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'pytest tests/ert/unit_tests tests/everest -n auto --hypothesis-profile=fast -m "not integration_test"')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@xjules xjules self-assigned this Jan 25, 2025
@xjules xjules changed the title zmq: reduce ack timeout in unexpected socket close test zmq: speed up tests Jan 25, 2025
Copy link

codspeed-hq bot commented Jan 25, 2025

CodSpeed Performance Report

Merging #9875 will not alter performance

Comparing xjules:speedup_zmq_tests (cc8586c) with main (b64af27)

Summary

✅ 24 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

1 participant