tests: every held request of the journey starts after the load, the parked fetch of the category page too

The held fetch /hold?id=park of the category page (steps 7 and 8) was started by the noise script while the page was parsed, so
on an engine that announces a request before the commit the client attributed it to the previous document and did not count it.
It now starts from afterLoad(0, ...) like the keepalive fetch of the search page; URL, method and end are unchanged.
The unit test covers every held request (/hold with until) of every page of the steps that are not idle (7, 8, 12), and that no
other page of the journey holds one while it is parsed.
This commit is contained in:
feder-cr committed 2026-11-22 18:40:02 +01:00
1 parent 3946c6c024
commit b10b15afdf
4 files changed
+171 -124

No files matched your search

+2 -2
View File
@@ -14,7 +14,7 @@
{"id": "wrapper.e2e.fakeweb", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_fakeweb_p2_e2e.py", "tests/test_fakeweb_p4_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The fake web, offline: our browser on the hard pages (profile P2: a reused routed page reaches networkidle every time, also under a load of three other browsers; the other site is another process) and on the 17-step journey of a person (profile P4), each judged against what stock Firefox does, as tests/fakeweb/pages.json declares it. 4 = 3 + 1. Stock itself is held to that declaration, and compared with ours step by step, by scripts/run_fakeweb.py in .github/workflows/fakeweb.yml. Needs the candidate binary (STEALTHFOX_E2E_BINARY)."},
{"id": "wrapper.e2e.fontconfig", "giro": "G2", "os": ["linux"], "min_tests": 2, "exact": true, "tests": ["tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "Fontconfig exists only on Linux: the parent of the engine shows <GRE>/fonts to it (FcConfigAppFontAddDir) to rebuild a font from a path and a face index. On Windows DirectWrite opens the file from its path, with no folder to scan and no cache to read, so this test has no Windows counterpart.", "note": "2 = (1) the stand-in that runs the engine under strace stays in the engine's place, as the core launches it (the leader of a process group of its own): a fake engine with a child, no browser; the process the launcher holds lives as long as the fake engine, and the group killed holds strace and the child (the stand-in that exec'd setsid forked and exited 0 at once: candidate 44161687675); (2) the warm launch of the parent reads the bundle from fontconfig's cache and does not scan it again (from firefox-66, engine_at_least). Two launches under strace with the same XDG_CACHE_HOME of the test, the first cold and the second warm: the cold parent opens every font file of <GRE>/fonts (the folder as the disk lists it) before any page and fontconfig writes its cache; the warm parent does not open every one of them, and it opens a *.cache-* file of fontconfig (a few files are opened to be used, so the verdict asks about the whole folder, as a scan does). Scan and drawing are told apart by position: only what the parent opens before the first page counts (the opens that draw are written as after_startup). Evidence in RUNNER_TEMP/invpw-evidence/fontconfig-cache: the interval and the number of opens of the bundle, the names of the files of the bundle each launch opened before the first page, the size of the cache file, the VmRSS of the parent after about:blank and after a page with every family, and a third launch with gfx.bundled-fonts.activate=0 (the behaviour before), which is evidence only. Needs strace on the runner: without it both are red, not skipped. No threshold."},
{"id": "wrapper.unit.compositing", "giro": "G1", "os": ["linux", "windows"], "min_tests": 30, "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, and the box cut out of a screenshot (its pixels, a box outside the picture refused, written as a PNG and read back, two boxes told apart by a pixel that is named, the pixels that are not grey)."},
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 2271, "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_gives_the_core_its_engine_for_the_security_state.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_read_whose_probe_ran_out_is_the_callers_timeout.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_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_lab_intermediates.py", "tests/test_ci_lab_security_state.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_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.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_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_fakeweb_p4_report.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_motion_never_hides_a_programming_error.py", "tests/test_moving_page_model.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_legacy_in_the_wrapper.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", Line truncated
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2272, "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_gives_the_core_its_engine_for_the_security_state.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_read_whose_probe_ran_out_is_the_callers_timeout.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_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_lab_intermediates.py", "tests/test_ci_lab_security_state.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_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.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_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_fakeweb_p4_report.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_motion_never_hides_a_programming_error.py", "tests/test_moving_page_model.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_legacy_in_the_wrapper.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.Line truncated
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 2285, "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_gives_the_core_its_engine_for_the_security_state.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_read_whose_probe_ran_out_is_the_callers_timeout.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_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_lab_intermediates.py", "tests/test_ci_lab_security_state.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_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.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_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_held_request_of_the_journey_starts_after_the_load.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_fakeweb_p4_report.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_motion_never_hides_a_programming_error.py", "tests/test_moving_page_model.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_legacy_in_the_wrapper.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_areLine truncated
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2286, "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_gives_the_core_its_engine_for_the_security_state.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_read_whose_probe_ran_out_is_the_callers_timeout.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_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_lab_intermediates.py", "tests/test_ci_lab_security_state.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_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.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_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_held_request_of_the_journey_starts_after_the_load.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_fakeweb_p4_report.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_motion_never_hides_a_programming_error.py", "tests/test_moving_page_model.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_legacy_in_the_wrapper.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_Line truncated
{"id": "wrapper.e2e.securitystate", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_security_state_engine_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The security state the core declares, against the engine: the engine launched directly in its generate mode makes what it is given (the contract's result, security_state/ with the bytes of the full filter and of the delta, the core's own validation of it); a normal launch declares no pref of the mode and re-imports nothing; a certificate that Mozilla's CRLite test data say is revoked in a delta is refused at the first navigation (SEC_ERROR_REVOKED_CERTIFICATE) while a valid one loads, and the revoked one loads when the ready directory has no data; a ready directory with no or an empty security_state/ starts. Certificates made on the run (a fresh root trusted in cert9.db by the engine's own xpcshell, Mozilla's default test key as the key of CN=int), servers on loopback, no network. Red on firefox-67 (no generate mode)."}
]
+5 -5
View File
@@ -156,10 +156,10 @@ addEventListener('pagehide', () => {
# Page that stays "not idle" on purpose: its held request is released when the walk reaches this step.
PARK_PAGES = {"category": 9}
# Same with a keepalive fetch (a request the client must still count as in flight): the search page, until step 13.
# The fetch starts from a task after `load`, never while the page is parsed: the engine announces a request at once, but the
# commit of the document waits for the engine's handshake, so a request started during parsing can be announced before the
# commit and the client drops it at the commit (the reference Juggler does the same). The step tests the rule "an open
# keepalive holds networkidle", not that race.
# Both held fetches start from a task after `load`, never while the page is parsed: the engine announces a request at once, but
# the commit of the document waits for the engine's handshake, so a request started during parsing can be announced before the
# commit and the client drops it at the commit (the reference Juggler does the same). The steps test the rule "an open request
# holds networkidle", not that race.
PARK_KEEPALIVE_PAGES = {"search": 13}
@@ -168,7 +168,7 @@ def noise_script(ctx, park_until=None, park_keepalive_until=None):
return ""
js = DET_JS
if park_until:
js += "\nget(A + '/hold?id=park' + tok + '&until=%d');\n" % park_until
js += "\nafterLoad(0, () => get(A + '/hold?id=park' + tok + '&until=%d'));\n" % park_until
if park_keepalive_until:
js += ("\nafterLoad(0, () => fetch(A + '/hold?id=kapark' + tok + '&until=%d', {keepalive: true}).catch(noop));\n"
% park_keepalive_until)
@@ -0,0 +1,164 @@
"""Every request a page of the journey holds open on purpose is started after `load`, never while the page is parsed.
The steps that assert "an open request holds networkidle" (journey_p4.not_idle_steps in tests/fakeweb/pages.json) are the steps
of a page that holds a request until a later step: a fetch (the category page, steps 7 and 8) or a keepalive fetch (the search
results, step 12). The engine announces a request at once, but the commit of the new document waits for the engine's handshake;
a request started while the page is parsed can be announced before the commit and the client drops it there (the reference
Juggler does the same), so the step would test a race, not the rule. The served page must start every such request from a later
task. No browser: the page is read as it is served and its script is read as text.
"""
from __future__ import annotations
import json
import pathlib
import re
import urllib.request
import pytest
from fakeweb import journey_site, sites
pytestmark = pytest.mark.unit
PAGES_JSON = pathlib.Path(__file__).parent / "fakeweb" / "pages.json"
# The page(s) each step that must not reach networkidle shows while it waits (the steps of profile_p4.py: 7 opens the category
# page, 8 sorts it with pushState on the same document, 12 opens the search page and then its results for a query).
PAGES_OF_STEP = {
7: ["/category/world"],
8: ["/category/world?sort=new", "/category/world?sort=top"],
12: ["/search", "/search?q=quiet%20morning"],
}
# The page each parked name of journey_site stands for.
PATH_OF_PARKED = {"category": "/category/world", "search": "/search"}
# Every page of the journey, to show that no other page holds a request open at all.
JOURNEY_PAGES = ["/", "/category/world", "/article/1", "/search", "/search?q=harbour", "/signin", "/partner/1"]
# A held request with an end: `/hold?id=...&until=<step>`; the long poll `lp` has no end, the page releases it itself.
HELD = re.compile(r"/hold\?id=[^;]*until=")
def _scripts(page: str) -> list[str]:
out, pos = [], 0
while True:
start = page.find("<script>", pos)
if start < 0:
return out
end = page.index("</script>", start)
out.append(page[start + len("<script>"):end])
pos = end
def _without_deferred(js: str) -> str:
"""The script with every `afterLoad(...)` call removed: what is left runs while the page is parsed."""
out, i = [], 0
while True:
j = js.find("afterLoad(", i)
if j < 0:
out.append(js[i:])
return "".join(out)
out.append(js[i:j])
depth, k, quote = 0, j + len("afterLoad"), None
while k < len(js):
c = js[k]
if quote:
if c == "\\":
k += 1
elif c == quote:
quote = None
elif c in "'\"`":
quote = c
elif c == "(":
depth += 1
elif c == ")":
depth -= 1
if depth == 0:
break
k += 1
i = k + 1
def held_at_parse_time(page: str) -> list[str]:
"""The statements of the page's scripts that start a held request outside any afterLoad callback."""
return [m.group(0) for js in _scripts(page) for m in HELD.finditer(_without_deferred(js))]
def held_requests(page: str) -> list[str]:
"""Every held request the page starts, wherever in its scripts."""
return [m.group(0) for js in _scripts(page) for m in HELD.finditer(js)]
def _serve(path: str) -> str:
a, _o, stop = journey_site.start((0, 0))
try:
with urllib.request.urlopen(a + path) as r:
return r.read().decode("utf-8")
finally:
stop()
def _as_a_statement(page: str, held_id: str) -> str:
"""The page as it was when the held request was a statement of the script, not an afterLoad callback."""
prefix = "afterLoad(0, () => "
start = page.rindex(prefix, 0, page.index("/hold?id=" + held_id))
end = page.index("));", start) + 2 # the closing of the callback, then of afterLoad
return page[:start] + page[start + len(prefix):end - 1] + ";" + page[end + 1:]
STEP_PAGES = [(n, path) for n, paths in sorted(PAGES_OF_STEP.items()) for path in paths]
def test_the_steps_that_are_not_idle_are_the_steps_this_test_covers():
declared = json.loads(PAGES_JSON.read_text(encoding="utf-8"))["journey_p4"]["not_idle_steps"]
assert sorted(PAGES_OF_STEP) == sorted(declared)
def test_every_page_that_parks_a_request_is_a_page_of_a_step_that_is_not_idle():
parked = {PATH_OF_PARKED[name] for name in {**journey_site.PARK_PAGES, **journey_site.PARK_KEEPALIVE_PAGES}}
covered = {path.split("?")[0] for _n, path in STEP_PAGES}
assert parked == covered
@pytest.mark.parametrize("step,path", STEP_PAGES)
def test_a_page_of_a_step_that_is_not_idle_holds_a_request_and_starts_none_while_it_is_parsed(step, path):
page = _serve(path)
assert held_requests(page), "the page of step %d (%s) holds nothing any more: the step has nothing to test" % (step, path)
assert held_at_parse_time(page) == []
@pytest.mark.parametrize("path", JOURNEY_PAGES)
def test_no_page_of_the_journey_starts_a_held_request_while_it_is_parsed(path):
assert held_at_parse_time(_serve(path)) == []
@pytest.mark.parametrize("name", list(journey_site.PARK_PAGES))
def test_the_parked_fetch_keeps_its_url_its_method_and_its_end(name):
page = _serve(PATH_OF_PARKED[name])
parked = [js for js in _scripts(page) if "id=park' + tok" in js]
assert parked
assert "afterLoad(0, () => get(A + '/hold?id=park' + tok + '&until=%d'));" % journey_site.PARK_PAGES[name] in parked[0]
@pytest.mark.parametrize("name", list(journey_site.PARK_KEEPALIVE_PAGES))
def test_the_held_keepalive_fetch_is_a_keepalive_fetch_to_the_hold_route(name):
page = _serve(PATH_OF_PARKED[name])
deferred = [js for js in _scripts(page) if "id=kapark' + tok" in js]
assert deferred and "keepalive: true" in deferred[0]
assert "afterLoad(0, () => fetch(A + '/hold?id=kapark' + tok" in deferred[0]
def test_afterload_runs_its_callback_from_a_task_after_the_load_event():
prelude = sites.PRELUDE
assert "addEventListener('load'" in prelude and "setTimeout(f, ms)" in prelude
assert "document.readyState === 'complete'" in prelude
@pytest.mark.parametrize("path,held_id", [("/search", "kapark"), ("/category/world", "park")])
def test_the_check_sees_a_request_started_while_the_page_is_parsed(path, held_id):
"""On the old page the held request was a statement of the script, not a callback."""
old = _as_a_statement(_serve(path), held_id)
found = held_at_parse_time(old)
assert found != []
assert "/hold?id=" + held_id in found[0]
@@ -1,117 +0,0 @@
"""The page of a journey step that asserts "an open keepalive fetch holds networkidle" starts that fetch after `load`.
The engine announces a request at once, but the commit of the new document waits for the engine's handshake; a fetch started while
the page is parsed can be announced before the commit and the client drops it there (the reference Juggler does the same), so the
step would test a race. The served page must start the held keepalive fetch from a later task. No browser: the page is read as it
is served and its script is read as text.
"""
from __future__ import annotations
import urllib.request
import pytest
from fakeweb import journey_site, sites
pytestmark = pytest.mark.unit
HELD = "kapark" # the id prefix of the held keepalive fetch
def _scripts(page: str) -> list[str]:
out, pos = [], 0
while True:
start = page.find("<script>", pos)
if start < 0:
return out
end = page.index("</script>", start)
out.append(page[start + len("<script>"):end])
pos = end
def _without_deferred(js: str) -> str:
"""The script with every `afterLoad(...)` call removed: what is left runs while the page is parsed."""
out, i = [], 0
while True:
j = js.find("afterLoad(", i)
if j < 0:
out.append(js[i:])
return "".join(out)
out.append(js[i:j])
depth, k, quote = 0, j + len("afterLoad"), None
while k < len(js):
c = js[k]
if quote:
if c == "\\":
k += 1
elif c == quote:
quote = None
elif c in "'\"`":
quote = c
elif c == "(":
depth += 1
elif c == ")":
depth -= 1
if depth == 0:
break
k += 1
i = k + 1
def held_keepalive_at_parse_time(page: str) -> list[str]:
"""The statements of the page's scripts that start the held keepalive fetch outside any afterLoad callback."""
found = []
for js in _scripts(page):
for line in _without_deferred(js).splitlines():
if HELD in line:
found.append(line.strip())
return found
def _serve(path: str) -> str:
a, _o, stop = journey_site.start((0, 0))
try:
with urllib.request.urlopen(a + path) as r:
return r.read().decode("utf-8")
finally:
stop()
PAGES = ["/" + name for name in journey_site.PARK_KEEPALIVE_PAGES]
@pytest.mark.parametrize("path", PAGES)
def test_a_page_that_holds_a_keepalive_fetch_does_not_start_it_while_it_is_parsed(path):
page = _serve(path)
assert any(HELD in js for js in _scripts(page)), "the page of %s no longer holds a keepalive fetch: the step has nothing to test" % path
assert held_keepalive_at_parse_time(page) == []
@pytest.mark.parametrize("path", PAGES)
def test_the_held_keepalive_fetch_is_a_keepalive_fetch_to_the_hold_route(path):
page = _serve(path)
deferred = [js for js in _scripts(page) if HELD in js]
assert deferred and "keepalive: true" in deferred[0]
assert "afterLoad(0, () => fetch(A + '/hold?id=%s' + tok" % HELD in deferred[0]
def test_the_search_results_with_a_query_hold_it_too():
page = _serve("/search?q=harbour")
assert any(HELD in js for js in _scripts(page))
assert held_keepalive_at_parse_time(page) == []
def test_afterload_runs_its_callback_from_a_task_after_the_load_event():
prelude = sites.PRELUDE
assert "addEventListener('load'" in prelude and "setTimeout(f, ms)" in prelude
assert "document.readyState === 'complete'" in prelude
def test_the_check_sees_a_fetch_started_while_the_page_is_parsed():
"""On the old page the fetch was a statement of the script, not a callback."""
page = _serve("/search")
start = page.index("afterLoad(0, () => fetch(A + '/hold?id=" + HELD)
end = page.index("));", start) + 2
old = page[:start] + page[start + len("afterLoad(0, () => "):end - 1] + ";" + page[end + 1:]
assert held_keepalive_at_parse_time(old) != []
assert "fetch(A + '/hold?id=" + HELD in held_keepalive_at_parse_time(old)[0]