tests: networkidle quiet is judged on when the server starts to answer, not on a stamp after the write
The e2e test of networkidle with a frame of another site was red on the windows runner (run 44039376589): "after only 0.328 s
without network". The fake server stamped `done` after `wfile.write`, on a thread of the test process (the client runs in the
same process); that thread can lose the CPU or the GIL between the write and the stamp, so `done` was 0.2 s later than the real
end and the measured quiet shorter than the browser's.
The server now also stamps `sent`: after the delay, before send_response/write, the first instant the browser can have seen the
end. quiet_problem judges on it (in flight = sent None or after the return; quiet = return - max(sent)). A correct product returns
at least 0.5 s after `sent` under any load; one that ignores the requests of the frame returns earlier. The tolerance QUIET = 0.4
is gone: the threshold is the promise (IDLE_QUIET, invisible_core/juggler/lifecycle.py:56) less the resolution that
time.get_clock_info("monotonic") declares, the clock the core's timer reads (lifecycle.py:340, 541, 551).
Unit tests: the timestamps of the failed run are green, a product that returns early is red, a request not yet written at the
return is in flight, the tolerance is the declared resolution, and the fake server's `sent` is after the delay and before `done`.
min_tests of wrapper.unit.all.linux/windows: +5.
This commit is contained in:
1 parent
7ab22b0961
commit
4d930e21c0
5 files changed
+124
-42
No files matched your search
@@ -12,6 +12,6 @@
|
||||
{"id": "wrapper.unit.page", "giro": "G1", "os": ["linux", "windows"], "min_tests": 72, "exact": true, "tests": ["tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_page_number_follows_the_call.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_the_hand_over_of_a_popup_holds_under_concurrency.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py"], "marker": "unit", "needs_root": false, "note": "72 = 44 + 3+9+5+1+10 of the popup hand-over (24 counted at the collection before; was 20 = 3+8+1+8 before 6200bc2). The page dispatcher's wait for Page.ready and what it hands over; the drive gate goes through the core (the engine waits for the session's road)."},
|
||||
{"id": "wrapper.e2e.compositing", "giro": "G2", "os": ["linux", "windows"], "min_tests": 3, "exact": true, "tests": ["tests/test_software_compositing_is_declared_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The engine DECLARES software compositing on every machine (core: the compositing entries of zoom.stealth.gfx.feature_status carry the VM decision, and on Windows gfx.webrender.software=true, gfx.webrender.software.d3d11=false). 3 = (1) the compositor read from a privileged context is 'WebRender (Software)' on Windows and on Linux (windowUtils.layerManagerType of each window: Troubleshoot.snapshot().graphics throws on this engine, `ext is null`, so it is not the route); (2) the GPU process uses under 1.5 s of CPU on the fixed 10-scene loop of one browser (Windows runner: 0.32 s declared, 2.7-4.2 s not, runs 43652292533 and 43642744101; on Linux it is held to the bound if a GPU process exists); (3) the 86 keys of the page-bytes probe plus the canvas 2D scenes (drawImage scaled with smoothing off/low/medium/high, text with linear/radial/conic gradients) equal tests/data/page_bytes_<os>.json, PNGs on decoded pixels. EXPECTED RED on the core 64.71.0 (tests 1 and 2 on Windows). The reference of Windows holds the 75 stable keys and 6 of the 11 PNG keys of run 43652292533; the five other PNG keys and the new canvas keys, and all of Linux, are written from the first run on the engine of the reference (the failure of test 3 prints RECORD-BEGIN ... RECORD-END with the entries to merge): a reference that is not complete is red, never skipped."},
|
||||
{"id": "wrapper.unit.compositing", "giro": "G1", "os": ["linux", "windows"], "min_tests": 19, "exact": true, "tests": ["tests/test_the_page_bytes_reference_compares_decoded_pixels.py"], "marker": "unit", "needs_root": false, "note": "The helpers of wrapper.e2e.compositing on known inputs, no browser: the PNG compared on decoded pixels (another deBG chunk and compression are the same, one pixel is not, every scanline filter), the comparison with a reference (changed, missing and extra keys named, the entry to record), the type of an engine process, an engine process known by its executable and not by the name it gives itself (Linux), and the CPU of a window, and the shape of the committed Windows reference."},
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 2048, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_backcompat.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_css_calc_is_windows_e2e.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_math_sin_cos_tan_are_windows_e2e.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_preload_newtab_reaches_the_core_only_when_asked.py", "tests/test_protocol_names_are_declared.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_publish_gate_wiring.py", "tests/test_pyproject_names_real_paths.py", "tests/test_Line truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2049, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_backcompat.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_css_calc_is_windows_e2e.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_math_sin_cos_tan_are_windows_e2e.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_prefs_composition_arm_on_windows.py", "tests/test_preload_newtab_reaches_the_core_only_when_asked.py", "tests/test_protocol_names_are_declared.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_publish_gate_wiring.py", "tests/test_pyproject_names_real_pathsLine truncated
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 2053, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_backcompat.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_css_calc_is_windows_e2e.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_math_sin_cos_tan_are_windows_e2e.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_preload_newtab_reaches_the_core_only_when_asked.py", "tests/test_protocol_names_are_declared.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_publish_gate_wiring.py", "tests/test_pyproject_names_real_paths.py", "tests/test_Line truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2054, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_backcompat.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_css_calc_is_windows_e2e.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_math_sin_cos_tan_are_windows_e2e.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_prefs_composition_arm_on_windows.py", "tests/test_preload_newtab_reaches_the_core_only_when_asked.py", "tests/test_protocol_names_are_declared.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_publish_gate_wiring.py", "tests/test_pyproject_names_real_pathsLine truncated
|
||||
]
|
||||
@@ -64,13 +64,17 @@ class Sites:
|
||||
site = self.server.site
|
||||
length = int(self.headers.get("Content-Length") or 0)
|
||||
self.body = self.rfile.read(length) if length else b""
|
||||
# `at` is when it arrived and `done` when its answer was written (the clock of the test process):
|
||||
# what a test needs to say how long the network was quiet between two requests
|
||||
# `at` is when it arrived, `sent` the instant before its answer starts to be written (after the delay) and
|
||||
# `done` when the write returned (the clock of the test process). `sent` is the first instant the browser can
|
||||
# have seen the request end, so it is what says how long the network was quiet: `done` is taken by a thread
|
||||
# of the test process, which can lose the CPU or the GIL between the write and the stamp (the client runs in
|
||||
# this process), and is then later than the real end.
|
||||
entry = {"site": site, "path": url.path, "query": self.query, "method": self.command,
|
||||
"headers": dict(self.headers), "at": time.monotonic(), "done": None}
|
||||
"headers": dict(self.headers), "at": time.monotonic(), "sent": None, "done": None}
|
||||
sites.requests.append(entry)
|
||||
spec = sites._routes.get((site, url.path))
|
||||
if spec is None:
|
||||
entry["sent"] = time.monotonic()
|
||||
self.send_response(404)
|
||||
self.send_header("Content-Length", "0")
|
||||
self.end_headers()
|
||||
@@ -81,6 +85,7 @@ class Sites:
|
||||
body = body.encode("utf-8")
|
||||
if spec["delay"]:
|
||||
time.sleep(spec["delay"])
|
||||
entry["sent"] = time.monotonic()
|
||||
try:
|
||||
self.send_response(spec["status"])
|
||||
self.send_header("Content-Type", spec["ctype"])
|
||||
|
||||
+35
-10
@@ -114,21 +114,46 @@ def spare_processes(total_memory_bytes: Optional[int], lowmem_mb: int = 4096, fi
|
||||
return fission_number
|
||||
|
||||
|
||||
def quiet_problem(stamps: Iterable[Tuple[str, float, Optional[float]]], returned: float, quiet: float) -> Optional[str]:
|
||||
"""What is wrong with a `networkidle` that came at ``returned`` (None if nothing), from ``(path, arrival, end)``
|
||||
stamps of the requests of the page on the server's clock (``end`` None: not answered yet).
|
||||
#: What `networkidle` promises: no request in flight, and this many seconds since the last request ended
|
||||
#: (`IDLE_QUIET = 0.5`, invisible_core/juggler/lifecycle.py:56, the core the wrapper pins: the timer is the core's, not this
|
||||
#: package's).
|
||||
NETWORKIDLE_PROMISE = 0.5
|
||||
|
||||
|
||||
def quiet_needed(clock: str = "monotonic") -> float:
|
||||
"""The silence a `networkidle` is asked for: the promise less the resolution the clock in use declares, and nothing else.
|
||||
|
||||
The timer that decides `networkidle` is `Lifecycle._settle` in invisible_core/juggler/lifecycle.py (the core pinned by
|
||||
this wrapper; the wrapper's server only forwards the state, `_juggler/server.py` `_hear_lifecycle`). It reads
|
||||
`time.monotonic()` (lifecycle.py:340) and compares it with the instant of the last request event, also
|
||||
`time.monotonic()` (lifecycle.py:541 for a request that begins, :551 for one that ends), against `IDLE_QUIET`
|
||||
(lifecycle.py:352). The stamps of the tests are `time.monotonic()` too, in the same process. A clock that advances in
|
||||
steps of `r` (`time.get_clock_info("monotonic").resolution`: 15.625 ms on Windows, `GetTickCount64`) makes two readings
|
||||
differ from the true interval by less than `r`, so the product that waited the whole promise can be measured up to `r`
|
||||
short. That is a property of the instrument, read from the clock, not an estimate of how loaded a runner is."""
|
||||
return NETWORKIDLE_PROMISE - time.get_clock_info(clock).resolution
|
||||
|
||||
|
||||
def quiet_problem(stamps: Iterable[Tuple[str, float, Optional[float]]], returned: float,
|
||||
clock: str = "monotonic") -> Optional[str]:
|
||||
"""What is wrong with a `networkidle` that came at ``returned`` (None if nothing), from ``(path, arrival, sent)``
|
||||
stamps of the requests of the page on the server's clock (``sent`` None: its answer was not yet being written).
|
||||
|
||||
`networkidle` promises that no request is in flight and that half a second has passed since the last one ended.
|
||||
Asked here for ``quiet`` (a little under the half second, because the client hears of an end a moment after the
|
||||
server writes it). A late request that has not even arrived is no reason to complain when the network really was
|
||||
quiet before ``returned``, and a request in flight, or an end too near, is."""
|
||||
``sent`` is the first instant the browser can have seen a request end: the server takes it after its delay and
|
||||
BEFORE it writes the answer. Judging on it, never on a stamp taken after the write, is what makes the verdict true under
|
||||
any load: a thread of the test process that loses the CPU or the GIL between the write and a later stamp makes that
|
||||
stamp late and the silence measured shorter than it was, while a correct product returns at least half a second
|
||||
after ``sent`` whatever the load, and one that ignores a request of a frame returns sooner. A late request that has
|
||||
not even arrived is no reason to complain when the network really was quiet before ``returned``; a request not yet
|
||||
sent at ``returned``, or an end too near, is."""
|
||||
stamps = list(stamps)
|
||||
in_flight = [path for path, _arrival, end in stamps if end is None or end > returned]
|
||||
in_flight = [path for path, _arrival, sent in stamps if sent is None or sent > returned]
|
||||
if in_flight:
|
||||
return "networkidle came while %s was in flight" % in_flight
|
||||
if not stamps:
|
||||
return "no request of the page was seen at all"
|
||||
since = returned - max(end for _path, _arrival, end in stamps)
|
||||
if since < quiet:
|
||||
return "networkidle came after only %.3f s without network (it promises 0.5)" % since
|
||||
since = returned - max(sent for _path, _arrival, sent in stamps)
|
||||
if since < quiet_needed(clock):
|
||||
return "networkidle came after only %.3f s without network (it promises %s)" % (since, NETWORKIDLE_PROMISE)
|
||||
return None
|
||||
@@ -166,12 +166,6 @@ def test_a_route_set_before_the_load_fulfills_what_the_frame_asks_while_loading(
|
||||
assert not sites.seen("B", "/api/b"), "the request reached the server through the route"
|
||||
|
||||
|
||||
#: `networkidle` promises half a second WITHOUT network. The test below measures the silence on the server's clock and asks
|
||||
#: for this much, 100 ms under the promise: the two clocks are one process's, but the client hears about an end a little
|
||||
#: after the server writes it.
|
||||
QUIET = 0.4
|
||||
|
||||
|
||||
def test_networkidle_waits_for_the_late_requests_of_a_frame_of_another_site(page, sites):
|
||||
"""The frame makes a request 200 ms after it loads, and the next one as soon as that answers (the server holds
|
||||
each for 300 ms): there is never half a second without a request, so `networkidle` of the PAGE is not reached
|
||||
@@ -180,8 +174,9 @@ def test_networkidle_waits_for_the_late_requests_of_a_frame_of_another_site(page
|
||||
"Never half a second" is made by the page's own timer and promise chain, and a loaded machine can stretch them:
|
||||
when the 200 ms timer fires after 500 ms the page IS idle, and `networkidle` is right to come first. So the test
|
||||
does not assume the late requests came in time; it asks what `networkidle` promises, with the server's clock
|
||||
(each request's arrival and end are stamped in the test process): when `goto` returned, no request of the page
|
||||
was in flight and the network had been quiet for `QUIET`. A product that comes before the late requests of the
|
||||
(each request's arrival and `sent`, the instant its answer starts to be written, are stamped in the test process):
|
||||
when `goto` returned, no request of the page was in flight and the network had been quiet for the promise
|
||||
(`quiet_problem`: half a second, less the resolution of the clock). A product that comes before the late requests of the
|
||||
frame returns while one is in flight, or less than that after the last end, and fails; a slow machine that
|
||||
delays the frame's script returns after a real silence and passes. The message gives the four requests on the
|
||||
server's clock and when `goto` returned."""
|
||||
@@ -197,14 +192,14 @@ def test_networkidle_waits_for_the_late_requests_of_a_frame_of_another_site(page
|
||||
page.goto(sites.url("A", "/late-top"), wait_until="networkidle", timeout=30000)
|
||||
returned = time.monotonic()
|
||||
paths = ("/late-top", "/late-frame", "/late/1", "/late/2")
|
||||
stamps = [(r["path"], r["at"], r["done"]) for r in list(sites.requests) if r["path"] in paths]
|
||||
stamps = [(r["path"], r["at"], r["sent"]) for r in list(sites.requests) if r["path"] in paths]
|
||||
wait_frame(page, sites.url("B"), "/late-frame")
|
||||
began = min(at for _path, at, _done in stamps)
|
||||
timeline = "; ".join("%s +%.3fs..%s" % (path, at - began, "+%.3fs" % (done - began) if done is not None else "in flight")
|
||||
for path, at, done in sorted(stamps, key=lambda stamp: stamp[1]))
|
||||
began = min(at for _path, at, _sent in stamps)
|
||||
timeline = "; ".join("%s +%.3fs..%s" % (path, at - began, "+%.3fs" % (sent - began) if sent is not None else "in flight")
|
||||
for path, at, sent in sorted(stamps, key=lambda stamp: stamp[1]))
|
||||
explain = "the requests on the server's clock: %s; goto returned at +%.3fs" % (timeline, returned - began)
|
||||
assert {"/late-top", "/late-frame"} <= {path for path, _at, _done in stamps}, explain
|
||||
problem = quiet_problem(stamps, returned, QUIET)
|
||||
assert {"/late-top", "/late-frame"} <= {path for path, _at, _sent in stamps}, explain
|
||||
problem = quiet_problem(stamps, returned)
|
||||
assert problem is None, "%s: %s" % (problem, explain)
|
||||
page.wait_for_load_state("networkidle")
|
||||
|
||||
|
||||
@@ -8,17 +8,23 @@ sleep), for the case each test must still call red and the case it must call gre
|
||||
* keepalive request: an end that never comes is red when the deadline passes; one that comes late is green;
|
||||
* an iframe that has not reached its address, and a count of processes that stays above the bound (a frame process that
|
||||
is never released), are red after their deadline, with what was seen in the message;
|
||||
* `networkidle`: red when it comes while a request is in flight or too soon after the last one, green after a real
|
||||
silence even when the late requests of the frame never came;
|
||||
* `networkidle`: judged on `sent`, the instant before the server writes an answer (the first instant the browser can have
|
||||
seen the end), never on a stamp taken after the write: red when it comes while a request is in flight or too soon after
|
||||
the last one, green after a real silence even when the late requests of the frame never came and when the server's
|
||||
thread was late with its own stamp; the tolerance is the promise less the declared resolution of the clock;
|
||||
* the page of the TURN test stops its tick the moment a srflx arrives, before the POST.
|
||||
"""
|
||||
import asyncio
|
||||
import inspect
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
import pytest
|
||||
|
||||
import _fission_frames as ff
|
||||
import _turn_chain as chain_mod
|
||||
from _waits import Timeline, awatch, quiet_problem, spare_processes, wait_until, watch, without_end
|
||||
from _waits import Timeline, awatch, quiet_needed, quiet_problem, spare_processes, wait_until, watch, without_end
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
@@ -177,25 +183,76 @@ def test_the_pool_of_spare_content_processes_is_retails():
|
||||
|
||||
|
||||
def test_networkidle_is_red_while_a_request_is_in_flight_and_too_soon_after_the_last_end():
|
||||
quiet = 0.4
|
||||
# (path, arrival, sent): `sent` is the instant before the answer starts to be written
|
||||
chain = [("/late-top", 0.0, 0.01), ("/late-frame", 0.02, 0.03), ("/late/1", 0.23, 0.53), ("/late/2", 0.53, 0.83)]
|
||||
# a product that comes with the top page alone: at 0.5 /late/1 is still in flight
|
||||
assert "in flight" in quiet_problem(chain[:2] + [("/late/1", 0.23, None)], 0.5, quiet)
|
||||
assert "in flight" in quiet_problem(chain, 0.7, quiet) # /late/2 ends at 0.83
|
||||
# a product that comes with the top page alone: at 0.5 /late/1 is not yet sent
|
||||
assert "in flight" in quiet_problem(chain[:2] + [("/late/1", 0.23, None)], 0.5)
|
||||
assert "in flight" in quiet_problem(chain, 0.7) # /late/2 is sent at 0.83
|
||||
# a product that comes 100 ms after the last end instead of half a second
|
||||
assert "after only 0.100 s" in quiet_problem(chain, 0.93, quiet)
|
||||
assert "after only 0.100 s" in quiet_problem(chain, 0.93)
|
||||
# the promise kept: 0.5 s after the last end
|
||||
assert quiet_problem(chain, 1.33, quiet) is None
|
||||
assert quiet_problem([], 1.0, quiet) is not None
|
||||
assert quiet_problem(chain, 1.35) is None
|
||||
assert quiet_problem([], 1.0) is not None
|
||||
|
||||
|
||||
def test_networkidle_is_green_after_a_real_silence_even_if_the_late_requests_never_came():
|
||||
quiet = 0.4
|
||||
# the frame's script was held up for more than half a second: the page was idle, and networkidle came 0.52 s after
|
||||
# the last end, before /late/1 arrived; that is what the product promises, so it is not a failure
|
||||
seen = [("/late-top", 0.0, 0.01), ("/late-frame", 0.02, 0.03)]
|
||||
assert quiet_problem(seen, 0.55, quiet) is None
|
||||
assert quiet_problem(seen, 0.20, quiet) is not None # but not at 0.2 s
|
||||
assert quiet_problem(seen, 0.55) is None
|
||||
assert quiet_problem(seen, 0.20) is not None # but not at 0.2 s
|
||||
|
||||
|
||||
# The run 44039376589 (windows, e2e part 3) in the server's stamps, in seconds from the first request: /late/2 arrived at
|
||||
# 1.187 and was held 0.3 s, so its answer started to be written at 1.487; the stamp taken AFTER the write said 1.687, 0.2 s
|
||||
# later, because the thread of the server (it shares the process with the client) lost the CPU or the GIL in between.
|
||||
# The browser heard the end at 1.487 and waited its half second: `goto` returned at 2.015.
|
||||
FAILED_RUN = [("/late-top", 0.000, 0.000), ("/late-frame", 0.562, 0.562), ("/late/1", 0.890, 1.190),
|
||||
("/late/2", 1.187, 1.487)]
|
||||
|
||||
|
||||
def test_a_networkidle_that_waited_the_promise_is_green_whatever_the_server_thread_did_after_the_write():
|
||||
# the end the browser could see is `sent` (1.487), not the late stamp of the write (1.687): 0.528 s of quiet
|
||||
assert quiet_problem(FAILED_RUN, 2.015) is None
|
||||
# and a stamp taken at 1.687 would have said 0.328 s, which is the red of that run: it was the stamp, not the network
|
||||
assert quiet_problem(FAILED_RUN[:3] + [("/late/2", 1.187, 1.687)], 2.015) is not None
|
||||
|
||||
|
||||
def test_a_networkidle_that_ignores_the_requests_of_the_frame_is_red_under_any_load():
|
||||
# a product that comes 213 ms after the last answer started: the frame's request counts, and this one does not
|
||||
assert "after only 0.213 s" in quiet_problem(FAILED_RUN, 1.700)
|
||||
assert "after only 0.013 s" in quiet_problem(FAILED_RUN, 1.500)
|
||||
|
||||
|
||||
def test_a_request_not_yet_written_when_networkidle_came_is_in_flight():
|
||||
assert "/late/2" in quiet_problem(FAILED_RUN[:3] + [("/late/2", 1.187, None)], 2.015) # held, never written
|
||||
assert "/late/2" in quiet_problem(FAILED_RUN, 1.400) # written after the return
|
||||
|
||||
|
||||
def test_the_tolerance_is_the_promise_less_the_resolution_the_clock_declares():
|
||||
resolution = time.get_clock_info("monotonic").resolution
|
||||
assert quiet_needed() == pytest.approx(0.5 - resolution)
|
||||
# one resolution short of the promise is read as kept (the clock cannot tell it from the promise), a larger shortfall is not
|
||||
chain = [("/a", 0.0, 1.0)]
|
||||
assert quiet_problem(chain, 1.0 + 0.5 - resolution / 2) is None
|
||||
assert quiet_problem(chain, 1.0 + 0.5 - 2 * resolution - 0.001) is not None
|
||||
assert "QUIET" not in inspect.getsource(quiet_problem)
|
||||
|
||||
|
||||
def test_the_fake_server_stamps_sent_after_the_delay_and_before_the_write():
|
||||
with ff.Sites() as sites:
|
||||
sites.route("A", "/held", "late", ctype="text/plain", delay=0.2)
|
||||
sites.route("A", "/now", "now", ctype="text/plain")
|
||||
for path in ("/held", "/now", "/nothing"):
|
||||
try:
|
||||
urllib.request.urlopen(sites.url("A", path), timeout=10).read()
|
||||
except urllib.error.HTTPError:
|
||||
pass
|
||||
entries = {r["path"]: r for r in sites.requests}
|
||||
for entry in entries.values():
|
||||
assert entry["at"] <= entry["sent"] <= entry["done"]
|
||||
assert entries["/held"]["sent"] - entries["/held"]["at"] >= 0.2 - time.get_clock_info("monotonic").resolution
|
||||
assert entries["/now"]["sent"] - entries["/now"]["at"] < 0.2
|
||||
|
||||
|
||||
def test_the_turn_page_stops_its_tick_before_the_post_not_after_it():
|
||||
|
||||
Reference in new issue
Block a user