Release 0.57.0: invisible-core 67.78.0 (no value kept in memory, the intermediates list checked by fetch, networkidle from the commit) (#537)
* fetch: look for a newer intermediates list (update_intermediates) instead of only caching one Needs invisible-core with update_intermediates (the core release after 67.77.0). * launch: the UDP verdict travels in the prefs to the server; the core keeps none The core no longer remembers the UDP verdict of a proxy, so the launch's geo step hands it to the server in the prefs (invisible.server.udp_exit, taken out before the profile is written, never what a caller wrote) and op_launch gives it to launch_proxy_command. Every entry point keeps SessionGeo.udp_exit on its session. Tests that read the core's cache for the verdict now read it where it is written: the one function that renders the engine's proxy command is spied by conftest (tests/_udp_line.py). The tests that reset the core's cached seal drop the reset (the core reads the seal on every call). * Release 0.57.0: pins invisible-core 67.78.0 (no cache in memory in the core; fetch checks the intermediates list), same engine firefox-67 * launch: the UDP verdict is passed to launch_proxy_command by name (keyword-only in the core 67.78.0) * CHANGELOG 0.57.0: networkidle of a new document counts its quiet from the commit (core 67.78.0)
This commit is contained in:
1 parent
7c6aa59bd2
commit
10821ac225
24 files changed
+215
-108
No files matched your search
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.57.0] - 2026-11-20
|
||||
|
||||
### Changed
|
||||
- Pins invisible-core 67.78.0 (same engine, firefox-67). The core keeps no value in memory between two calls: the seal, the identity of the engine,
|
||||
the GPU tables, the time zones, the keyboard tables, the exit address and the UDP verdict of a proxy are read or measured each time they are needed,
|
||||
so what a launch costs is visible where it is paid.
|
||||
- `invisible-playwright fetch` looks for a newer list of intermediate certificates every time it runs (a small request; the list is downloaded only
|
||||
when Mozilla changed it). A launch only reads the list on disk and starts no background check.
|
||||
- `new_context(proxy=...)` measures the UDP exit of its proxy every time, instead of reusing a measurement of the same proxy from the last 30 minutes.
|
||||
- A launch without a proxy asks for its exit address every time, instead of reusing an answer from the last 2 minutes.
|
||||
- The UDP verdict the session measured at launch is handed to the browser's proxy command explicitly.
|
||||
|
||||
### Fixed
|
||||
- `wait_for_load_state("networkidle")` and `goto(..., wait_until="networkidle")` on a new document count the quiet from that document's
|
||||
commit, as Playwright does: the silence before the commit no longer counts toward its 500 ms.
|
||||
|
||||
## [0.56.0] - 2026-11-19
|
||||
|
||||
### Engine firefox-67
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
{"id": "wrapper.e2e.compositing", "giro": "G2", "os": ["linux", "windows"], "min_tests": 9, "exact": true, "tests": ["tests/test_software_compositing_is_declared_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_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. 9 = those 3 + the 6 families of tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py (from firefox-66, engine_at_least): a screenshot draws the text of Arial, Times New Roman, Consolas and Segoe UI, with accents, the typographic apostrophe, the euro sign, Chinese, Arabic and Russian, and of MS PGothic (face 2 of msgothic5_32.ttc: Japanese and Latin) and NSimSun (face 1 of simsun.ttc: Chinese), two faces that are not the first of their collection, with the same bytes as the content process drew them in a canvas (an SVG image with a foreignObject of the same markup), cut from the same page.screenshot, on both systems and with no threshold. EXPECTED RED on every engine that rebuilds the text in the parent with another font than the bundle (Linux: fontconfig answers DejaVu Sans), and skipped, hence red here, on an engine older than firefox-66. It saves the screenshot, the two boxes and a result.json under RUNNER_TEMP/invpw-evidence."},
|
||||
{"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": 2141, "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_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_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_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_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.py", "tests/test_prefs_composition_arm.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_protocol_names_are_declared.py", "tests/test_proxy_reaches_the_broLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2142, "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_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_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_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_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.py", "tests/test_prefs_composition_arm.py", "tests/test_prefs_composition_arm_on_windows.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_protocol_names_are_declared.py", "tests/test_proLine truncated
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 2144, "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_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_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_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_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.py", "tests/test_prefs_composition_arm.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_protocol_names_are_declared.py", "tests/test_proxy_reaches_the_broLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2145, "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_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_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_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_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.py", "tests/test_prefs_composition_arm.py", "tests/test_prefs_composition_arm_on_windows.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_protocol_names_are_declared.py", "tests/test_proLine truncated
|
||||
]
|
||||
+2
-2
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "invisible_playwright"
|
||||
version = "0.56.0"
|
||||
version = "0.57.0"
|
||||
description = "Playwright wrapper for a patched Firefox with deterministic stealth profile."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
@@ -69,7 +69,7 @@ dependencies = [
|
||||
# metadata; nothing in src/ hardcodes a second copy (tests/test_core_pin.py
|
||||
# fails if one appears). What stays invisible to install-time machinery is the
|
||||
# --no-deps / lockfile residue, and _pin.py is the only layer that sees it.
|
||||
"invisible_core==67.77.0",
|
||||
"invisible_core==67.78.0",
|
||||
# ⛔ playwright is NO LONGER a dependency: since the full fork, the Python
|
||||
# client lives in src/invisible_playwright/_pw/ and its server in
|
||||
# src/invisible_playwright/_juggler/ (no Node driver). Reintroducing it would not visibly
|
||||
|
||||
@@ -727,6 +727,7 @@ def _launch_params(session: Any, *, virtual_display: bool, headless: bool,
|
||||
session._locale = geo.locale
|
||||
session._webrtc_egress_ip = geo.egress_ip
|
||||
session._geolocation = geo.geolocation_override()
|
||||
session._udp_exit = geo.udp_exit
|
||||
executable = resolve_executable(session._binary_path)
|
||||
pw_headless = bool(headless)
|
||||
if not headless and virtual_display:
|
||||
|
||||
@@ -75,6 +75,7 @@ from ._marshal import (_js_number, _as_script, _button, _caller_timeout,
|
||||
# here for the length of one fix. Two readings of what a proxy is would be
|
||||
# the same duplication that produced the defect, one layer down.
|
||||
from invisible_core import SessionLocale, parse_proxy
|
||||
from invisible_core._proxy import UDP_EXIT_VALUES
|
||||
from invisible_core._udp_exit import context_proxy_command, launch_proxy_command, stun_servers
|
||||
|
||||
from invisible_core import write_user_js
|
||||
@@ -258,6 +259,11 @@ COMPOSED_PREF = "invisible.server.composed"
|
||||
#: a parameter of the Python launch, never a browser declaration. The server keeps it on the browser, so the launch
|
||||
#: and every later `new_context(proxy=...)` measure with the SAME list.
|
||||
UDP_STUN_PREF = "invisible.server.udp_stun_servers"
|
||||
#: THE VERDICT OF THAT MEASUREMENT (`SessionGeo.udp_exit`: `coherent`, `no`, `unmeasured`), made by the launcher's geo step
|
||||
#: and handed to this server the same way as the list above: in the prefs, taken out in `op_launch` before the profile is
|
||||
#: written. The core keeps no verdict in memory, so this is the only road it travels: `launch_proxy_command` declares what
|
||||
#: it is given, and `unmeasured` when it is given none. Not written when nothing was measured (no proxy, or not SOCKS5).
|
||||
UDP_EXIT_PREF = "invisible.server.udp_exit"
|
||||
#: The persona's keyboards, as Windows writes its input profiles (LANGID:KLID
|
||||
#: joined by semicolons, the language's first), decided by the core from the
|
||||
#: session's language AND country (`keyboard.profiles_for`). Server-only, like
|
||||
@@ -286,6 +292,7 @@ def take_session_motion(prefs: Dict) -> tuple:
|
||||
rest.pop(POINTER_PREF, None)
|
||||
rest.pop(COMPOSED_PREF, None)
|
||||
rest.pop(UDP_STUN_PREF, None)
|
||||
rest.pop(UDP_EXIT_PREF, None)
|
||||
return (rest,
|
||||
(None if seed is None else int(seed)),
|
||||
(None if budget_ms is None else int(budget_ms) / 1000.0))
|
||||
@@ -300,6 +307,13 @@ def session_udp_stun_servers(prefs: Dict) -> Optional[list]:
|
||||
return ["%s:%d" % server for server in stun_servers(str(value).split(","))]
|
||||
|
||||
|
||||
def session_udp_exit(prefs: Dict) -> Optional[str]:
|
||||
"""The verdict the launcher measured (`UDP_EXIT_PREF`), or None when it named none or a value the core does not
|
||||
declare: such a proxy is declared `unmeasured`, never `coherent`. Read BEFORE `take_session_motion` takes the key out."""
|
||||
value = prefs.get(UDP_EXIT_PREF)
|
||||
return value if value in UDP_EXIT_VALUES else None
|
||||
|
||||
|
||||
def session_for_launch(prefs: Dict, executable: str, proxy: Optional[Dict] = None) -> tuple:
|
||||
"""What a launch writes into its profile and adds to its environment: always a
|
||||
composed session. Returns (prefs, session_env).
|
||||
@@ -333,7 +347,8 @@ def session_for_launch(prefs: Dict, executable: str, proxy: Optional[Dict] = Non
|
||||
return dict(prefs), {}
|
||||
from invisible_playwright._session import default_session
|
||||
session_prefs, session_env = default_session(executable, proxy)
|
||||
return dict(session_prefs, **prefs), dict(session_env)
|
||||
# The verdict of the UDP measurement is the one `default_session` made, never one the caller wrote.
|
||||
return dict(session_prefs, **{k: v for k, v in prefs.items() if k != UDP_EXIT_PREF}), dict(session_env)
|
||||
|
||||
|
||||
def session_draws_pointer(prefs: Dict) -> bool:
|
||||
@@ -6215,6 +6230,7 @@ class BrowserTypeDispatcher(Dispatcher):
|
||||
params.get("firefoxUserPrefs") or {}, executable, params.get("proxy"))
|
||||
# Read BEFORE `take_session_motion` takes it out: it never reaches the profile.
|
||||
udp_stun_servers = session_udp_stun_servers(launch_prefs)
|
||||
udp_exit = session_udp_exit(launch_prefs)
|
||||
environment = _launch_environment(params.get("env"))
|
||||
named = {e["name"] for e in params.get("env") or []}
|
||||
environment.update({k: v for k, v in session_env.items() if k not in named})
|
||||
@@ -6270,9 +6286,10 @@ class BrowserTypeDispatcher(Dispatcher):
|
||||
proxy = None
|
||||
if params.get("proxy"):
|
||||
try:
|
||||
# The measure is the one the launch's geo step remembered for this proxy and these servers (nothing is
|
||||
# asked of the network here): `unmeasured` when there is none, never a claimed `coherent`.
|
||||
proxy = launch_proxy_command(params["proxy"], udp_stun_servers)
|
||||
# The measure is the one the launch's geo step made for this proxy, handed here in the prefs (nothing is
|
||||
# asked of the network here, and nothing is remembered): `unmeasured` when there is none, never a claimed
|
||||
# `coherent`.
|
||||
proxy = launch_proxy_command(params["proxy"], udp_exit=udp_exit)
|
||||
except ValueError as exc:
|
||||
raise ProtocolException("launch(proxy=...) cannot be applied: "
|
||||
"%s" % exc)
|
||||
|
||||
@@ -26,7 +26,7 @@ from ._cursor import (ENGINE_PYTHON,
|
||||
enable_for as _enable_cursor_engine,
|
||||
max_seconds_for as _cursor_max_seconds)
|
||||
from ._engine import resolve_executable
|
||||
from ._juggler.server import COMPOSED_PREF, MOTION_BUDGET_PREF, POINTER_PREF, SESSION_SEED_PREF, UDP_STUN_PREF
|
||||
from ._juggler.server import COMPOSED_PREF, MOTION_BUDGET_PREF, POINTER_PREF, SESSION_SEED_PREF, UDP_EXIT_PREF, UDP_STUN_PREF
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from invisible_core import compose_session_prefs, context_geometry, make_virtual_display
|
||||
@@ -97,6 +97,7 @@ def default_session(executable: Optional[str] = None,
|
||||
geo = session_geo(session._timezone, session._proxy, session._locale_requested,
|
||||
seed=session.seed)
|
||||
session._timezone, session._locale = geo.timezone, geo.locale
|
||||
session._udp_exit = geo.udp_exit
|
||||
session._geolocation = geo.geolocation_override()
|
||||
prefs = session._build_prefs()
|
||||
env = build_env(network_declared=declared_network(session), profile=session._profile,
|
||||
@@ -199,6 +200,7 @@ def build_prefs(
|
||||
show_cursor: Optional[bool] = None,
|
||||
session_seed: Optional[int] = None,
|
||||
udp_stun_servers: Optional[Any] = None,
|
||||
udp_exit: Optional[str] = None,
|
||||
preload_newtab: Optional[bool] = None,
|
||||
) -> Dict[str, Any]:
|
||||
"""Fingerprint prefs plus the humanize toggle, which is always set explicitly.
|
||||
@@ -283,6 +285,12 @@ def build_prefs(
|
||||
# takes the key out before the profile is written, as it does the seed. Not written when the launch named none.
|
||||
if udp_stun_servers:
|
||||
prefs[UDP_STUN_PREF] = ",".join(udp_stun_servers)
|
||||
# ⛔ AND THE VERDICT OF THAT MEASUREMENT (`SessionGeo.udp_exit`) rides with it (`UDP_EXIT_PREF`): the core keeps no verdict
|
||||
# in memory, so the server is told it here, and `op_launch` takes the key out as it does the list. Not written when nothing
|
||||
# was measured.
|
||||
prefs.pop(UDP_EXIT_PREF, None) # never what a caller wrote among its own prefs: only the measurement
|
||||
if udp_exit:
|
||||
prefs[UDP_EXIT_PREF] = udp_exit
|
||||
if session_seed is not None and humanize:
|
||||
prefs[SESSION_SEED_PREF] = int(session_seed)
|
||||
prefs[POINTER_PREF] = cursor_engine == ENGINE_PYTHON
|
||||
@@ -416,6 +424,11 @@ class CommonLaunch:
|
||||
#: launch geo step and the browser's later context proxies use the same list.
|
||||
_udp_stun_servers: Optional[list] = None
|
||||
|
||||
#: What the launch's geo step measured of the SOCKS5 proxy's UDP exit (``SessionGeo.udp_exit``: ``coherent``, ``no``,
|
||||
#: ``unmeasured``), or None when nothing was measured. Set by `__enter__` with the timezone; it travels to the server in
|
||||
#: the prefs (`UDP_EXIT_PREF`) because the core remembers none.
|
||||
_udp_exit: Optional[str] = None
|
||||
|
||||
def _resolve_headless(self) -> bool:
|
||||
"""Translate the user's ``headless`` flag.
|
||||
|
||||
@@ -573,6 +586,7 @@ class CommonLaunch:
|
||||
show_cursor=self._show_cursor,
|
||||
session_seed=self.seed,
|
||||
udp_stun_servers=self._udp_stun_servers,
|
||||
udp_exit=self._udp_exit,
|
||||
preload_newtab=self._preload_newtab,
|
||||
)
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@ class InvisiblePlaywright(_session.CommonLaunch):
|
||||
self._locale = _geo.locale
|
||||
self._webrtc_egress_ip = _geo.egress_ip
|
||||
self._geolocation = _geo.geolocation_override()
|
||||
self._udp_exit = _geo.udp_exit
|
||||
# binary_path= never reaches ensure_binary(), so the engine check lives
|
||||
# on the resolved executable rather than inside the fetcher.
|
||||
executable = resolve_executable(self._binary_path)
|
||||
|
||||
@@ -38,7 +38,7 @@ import argparse
|
||||
import sys
|
||||
|
||||
from . import __version__
|
||||
from invisible_core import BINARY_VERSION, FIREFOX_UPSTREAM_VERSION, ensure_intermediates
|
||||
from invisible_core import BINARY_VERSION, FIREFOX_UPSTREAM_VERSION, update_intermediates
|
||||
from invisible_core.download import cache_root, engine_root, ensure_binary # noqa: F401
|
||||
|
||||
from ._pin import (
|
||||
@@ -86,10 +86,11 @@ def _cmd_fetch(_args: argparse.Namespace) -> int:
|
||||
except Exception as e:
|
||||
print(f"error: {e}", file=sys.stderr)
|
||||
return 1
|
||||
# The list of preloaded intermediate certificates the core declares to the engine, cached now so the first launch does not download it in line. A
|
||||
# failure here is a warning and nothing more: it changes neither the exit code nor the last line (the launch declares the list again, or goes on without).
|
||||
# The list of preloaded intermediate certificates the core declares to the engine: `fetch` is where the user asks for what is current, so it looks for a
|
||||
# newer list EVERY time (a small request to the changes feed; the list is downloaded only when it changed) and puts it in the cache. A launch only reads the
|
||||
# cache. A failure here is a warning and nothing more: it changes neither the exit code nor the last line (`update_intermediates` itself does not raise).
|
||||
try:
|
||||
ensure_intermediates()
|
||||
update_intermediates()
|
||||
except Exception as e:
|
||||
print(f"warning: the intermediates list could not be fetched: {e}", file=sys.stderr)
|
||||
# Last line, alone, so `$(invisible-playwright fetch)` is a path.
|
||||
|
||||
@@ -277,6 +277,7 @@ class InvisiblePlaywright(_session.CommonLaunch):
|
||||
self._locale = _geo.locale
|
||||
self._webrtc_egress_ip = _geo.egress_ip
|
||||
self._geolocation = _geo.geolocation_override()
|
||||
self._udp_exit = _geo.udp_exit
|
||||
# binary_path= never reaches ensure_binary(), so the engine check lives
|
||||
# on the resolved executable rather than inside the fetcher.
|
||||
executable = resolve_executable(self._binary_path)
|
||||
|
||||
+41
-18
@@ -73,25 +73,48 @@ def egress_by_proxy(*gateways: Any, direct: Optional[str] = None) -> Callable[..
|
||||
return discover
|
||||
|
||||
|
||||
def declared_udp(proxy: Dict[str, Any], servers: Sequence[str]) -> str:
|
||||
"""The ``udp`` the launch measured for ``proxy`` with ``servers``: ``coherent``, ``no`` or ``unmeasured``. It is what the
|
||||
core remembered for the proxy (and declares to the engine); an AssertionError when the launch measured nothing, so
|
||||
``unmeasured`` cannot be mistaken for an absent measurement."""
|
||||
from invisible_core import _udp_exit
|
||||
from invisible_core._proxy import parse_proxy
|
||||
|
||||
endpoint = parse_proxy(proxy)
|
||||
key = _udp_exit.cache_key(endpoint, _udp_exit.stun_servers(list(servers)))
|
||||
entry = _udp_exit._cache.get(key)
|
||||
if entry is None:
|
||||
raise AssertionError("the launch measured nothing for %r with %s" % (proxy.get("server"), list(servers)))
|
||||
return entry[1]
|
||||
|
||||
|
||||
def declared_udp_or_absent(proxy: Dict[str, Any], servers: Sequence[str]) -> Optional[str]:
|
||||
""":func:`declared_udp`, or None when the launch measured nothing for ``proxy`` (a report must say that, not raise)."""
|
||||
#: What the core rendered into an engine proxy command during the running test, by proxy server: the ``udp`` of every
|
||||
#: ``Browser.setBrowserProxy`` / ``Browser.setContextProxy`` it built, in order. The core keeps no verdict in memory, so
|
||||
#: this is where a test reads what was declared: at the one place that writes it (see :func:`record_declared`).
|
||||
DECLARED: Dict[str, List[str]] = {}
|
||||
|
||||
|
||||
def record_declared(monkeypatch: Any) -> None:
|
||||
"""Record, for the running test, the ``udp`` of every proxy command the core renders (autouse in ``conftest.py``).
|
||||
|
||||
It spies ``invisible_core._udp_exit._command``: the one function that builds the engine command from a proxy and a
|
||||
verdict, whoever asks (the launch with the verdict the geo step made, a context after its own measurement). The spy
|
||||
delegates, and changes nothing the engine is told."""
|
||||
DECLARED.clear()
|
||||
try:
|
||||
return declared_udp(proxy, servers)
|
||||
from invisible_core import _udp_exit
|
||||
except Exception: # noqa: BLE001 - the package is absent: the tests that need it say so
|
||||
return
|
||||
real = _udp_exit._command
|
||||
|
||||
def spy(proxy: Dict[str, Any], udp: Any) -> Optional[Dict[str, Any]]:
|
||||
command = real(proxy, udp)
|
||||
if command is not None and "udp" in command:
|
||||
DECLARED.setdefault(proxy.get("server"), []).append(command["udp"])
|
||||
return command
|
||||
|
||||
monkeypatch.setattr(_udp_exit, "_command", spy)
|
||||
|
||||
|
||||
def declared_udp(proxy: Dict[str, Any]) -> str:
|
||||
"""The ``udp`` the core declared to the engine for ``proxy``, the last one of this test: ``coherent``, ``no`` or
|
||||
``unmeasured``. An AssertionError when nothing was declared for it, so ``unmeasured`` cannot be mistaken for an
|
||||
absent declaration."""
|
||||
declared = DECLARED.get(proxy.get("server"))
|
||||
if not declared:
|
||||
raise AssertionError("the core declared nothing for %r" % proxy.get("server"))
|
||||
return declared[-1]
|
||||
|
||||
|
||||
def declared_udp_or_absent(proxy: Dict[str, Any]) -> Optional[str]:
|
||||
""":func:`declared_udp`, or None when nothing was declared for ``proxy`` (a report must say that, not raise)."""
|
||||
try:
|
||||
return declared_udp(proxy)
|
||||
except AssertionError:
|
||||
return None
|
||||
|
||||
|
||||
+14
-16
@@ -164,13 +164,20 @@ def _offline_session_geo(request, monkeypatch):
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _a_unit_test_asks_mozilla_for_no_intermediates_list(request, monkeypatch):
|
||||
"""Outside the e2e, a launch declares no intermediates list and starts no check of it.
|
||||
def _what_the_core_declares_for_a_proxy_is_recorded(monkeypatch):
|
||||
"""The core keeps no UDP verdict in memory, so a test that wants to know what the launch declared reads it where it is
|
||||
written: `_udp_line.record_declared` spies the one function that renders the engine's proxy command (unit and e2e)."""
|
||||
from _udp_line import record_declared
|
||||
record_declared(monkeypatch)
|
||||
|
||||
The core's `write_user_js` (every launch the server makes) declares Mozilla's list: on a cold cache it downloads it in line, on a warm one the launch starts a
|
||||
background check, and the line it writes would differ with the cache of whoever runs the test. The two functions are stubbed, as the core's own suite does
|
||||
(tests/conftest.py of invisible-core): no list, no thread, no request. The tests of `fetch` set their own; a test marked `e2e` gets the real ones (the CI legs
|
||||
point them at the empty file of `ci/intermediates.json`)."""
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _a_unit_test_asks_mozilla_for_no_intermediates_list(request, monkeypatch):
|
||||
"""Outside the e2e, a launch declares no intermediates list.
|
||||
|
||||
The core's `write_user_js` (every launch the server makes) declares Mozilla's list: on a cold cache it downloads it in line, and the line it writes would
|
||||
differ with the cache of whoever runs the test. The function is stubbed, as the core's own suite does (tests/conftest.py of invisible-core): no list, no
|
||||
request. The tests of `fetch` set their own; a test marked `e2e` gets the real one (the CI legs point it at the empty file of `ci/intermediates.json`)."""
|
||||
if request.node.get_closest_marker("e2e") is not None:
|
||||
return
|
||||
try:
|
||||
@@ -178,7 +185,6 @@ def _a_unit_test_asks_mozilla_for_no_intermediates_list(request, monkeypatch):
|
||||
except Exception: # the package is absent: the tests that need it say so
|
||||
return
|
||||
monkeypatch.setattr(_im, "ensure_intermediates", lambda *a, **kw: None)
|
||||
monkeypatch.setattr(_im, "refresh_intermediates_in_background", lambda *a, **kw: None)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@@ -188,21 +194,13 @@ def _a_unit_test_does_not_depend_on_the_seal_of_whoever_runs_it(request, monkeyp
|
||||
The CI jobs export it (a LOCAL seal of the candidate, with no published assets) for the e2e tests that launch the engine under test. A unit test
|
||||
that composes a launch (``build_env``, ``launch_persistent_context``, a second browser served by a virtual display) reaches ``ensure_binary`` and
|
||||
died with ``SealError: the active seal ... is a LOCAL seal with no published assets`` only because of where it ran. Here the variable is taken out
|
||||
of the test's environment (``monkeypatch`` puts it back), and the seal the process had already resolved is dropped, so the test resolves the
|
||||
of the test's environment (``monkeypatch`` puts it back); the core reads the seal on every call, so the test resolves the
|
||||
packaged one; a test that wants a seal sets the variable itself, after this. The e2e tests, which are the ones that need it, keep it."""
|
||||
if request.node.get_closest_marker("e2e") is not None:
|
||||
yield
|
||||
return
|
||||
try:
|
||||
from invisible_core.seal import _reset_active_seal_for_tests
|
||||
except Exception: # the package is absent: the tests that need it say so
|
||||
_reset_active_seal_for_tests = None
|
||||
monkeypatch.delenv("INVISIBLE_SEAL_FILE", raising=False)
|
||||
if _reset_active_seal_for_tests is not None:
|
||||
_reset_active_seal_for_tests()
|
||||
yield
|
||||
if _reset_active_seal_for_tests is not None:
|
||||
_reset_active_seal_for_tests()
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
|
||||
@@ -57,7 +57,6 @@ class _Connection(EventListeners):
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _fresh(monkeypatch):
|
||||
monkeypatch.setattr(_udp_exit, "_cache", {})
|
||||
# The fake gateway answers the exit question the way the product asks it (api.ipify.org through socks5h), but
|
||||
# these tests are about the measurement, so the TCP exit is the gateway's own declaration.
|
||||
monkeypatch.setattr(_geo, "discover_egress_ip", lambda proxy=None, **kw: EXIT)
|
||||
@@ -115,19 +114,12 @@ def test_the_caller_never_declares_udp_on_a_context_proxy():
|
||||
assert _context_proxy(_apply({"proxy": dict(gw.proxy, udp="coherent")}, [gw]))[1]["udp"] == "no"
|
||||
|
||||
|
||||
def test_one_proxy_is_measured_once_however_many_contexts_are_given_it():
|
||||
def test_a_proxy_is_measured_again_for_every_context_given_it():
|
||||
"""Nothing is kept by the core: three contexts given one proxy are three measurements."""
|
||||
with coherent() as gw:
|
||||
for _ in range(3):
|
||||
for n in range(1, 4):
|
||||
assert _context_proxy(_apply({"proxy": dict(gw.proxy)}, [gw]))[1]["udp"] == "coherent"
|
||||
assert gw.associates == 1
|
||||
|
||||
|
||||
def test_the_cache_is_keyed_without_the_secret():
|
||||
with coherent(user="a", password="hunter2-zzz") as gw:
|
||||
_apply({"proxy": gw.proxy}, [gw])
|
||||
assert _udp_exit._cache
|
||||
for key in _udp_exit._cache:
|
||||
assert "hunter2-zzz" not in repr(key)
|
||||
assert gw.associates == n
|
||||
|
||||
|
||||
def test_the_credentials_are_used_on_the_socket_and_nowhere_else(caplog):
|
||||
@@ -201,7 +193,8 @@ def test_op_launch_reads_the_list_before_the_prefs_are_cleaned_and_writes_a_prof
|
||||
source = inspect.getsource(server.BrowserTypeDispatcher.op_launch)
|
||||
assert source.index("session_udp_stun_servers(launch_prefs)") < source.index("take_session_motion(launch_prefs)")
|
||||
assert source.index("take_session_motion(launch_prefs)") < source.index("write_user_js(")
|
||||
assert "launch_proxy_command(params[\"proxy\"], udp_stun_servers)" in source
|
||||
assert source.index("session_udp_exit(launch_prefs)") < source.index("take_session_motion(launch_prefs)")
|
||||
assert "launch_proxy_command(params[\"proxy\"], udp_exit=udp_exit)" in source
|
||||
assert "parse_proxy(params[\"proxy\"]).as_engine_command()" not in source
|
||||
|
||||
|
||||
@@ -236,7 +229,7 @@ def test_no_stun_address_reaches_the_browsers_environment_argv_prefs_or_pipe():
|
||||
executable=None, base_env={})
|
||||
# ...and what the engine is given: the prefs after the server took its own keys out, the environment, the pipe.
|
||||
browser_prefs, _seed, _budget = take_session_motion(prefs)
|
||||
pipe = repr(_udp_exit.launch_proxy_command({"server": "socks5://10.0.0.1:1080"}, servers))
|
||||
pipe = repr(_udp_exit.launch_proxy_command({"server": "socks5://10.0.0.1:1080"}, udp_exit="coherent"))
|
||||
given = repr(browser_prefs) + repr(env) + pipe
|
||||
for needle in servers + ["198.51.100.5", "203.0.113.9"]:
|
||||
assert needle not in given, needle
|
||||
@@ -247,5 +240,58 @@ def test_no_stun_address_reaches_the_browsers_environment_argv_prefs_or_pipe():
|
||||
def test_a_hand_made_launch_proxy_cannot_claim_a_coherent_udp():
|
||||
"""`launch(proxy={..., "udp": "coherent"})` through a bare client: nothing was measured, so `unmeasured`."""
|
||||
with mismatched() as gw:
|
||||
command = _udp_exit.launch_proxy_command(dict(gw.proxy, udp="coherent"), STUN)
|
||||
command = _udp_exit.launch_proxy_command(dict(gw.proxy, udp="coherent"))
|
||||
assert command["udp"] == "unmeasured"
|
||||
with mismatched() as gw:
|
||||
command = _udp_exit.launch_proxy_command(dict(gw.proxy, udp="coherent"), udp_exit="no")
|
||||
assert command["udp"] == "no", "the verdict handed over is what is declared, not what the proxy dict claims"
|
||||
|
||||
|
||||
# the verdict travels in the prefs: the core keeps none ---------------------------------------------------------
|
||||
def test_the_verdict_of_the_geo_step_reaches_the_server_in_the_prefs_and_is_declared_at_launch():
|
||||
from invisible_core import decide_session_locale
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
from invisible_playwright._juggler.server import UDP_EXIT_PREF, session_udp_exit
|
||||
proxy = {"server": "socks5://10.0.0.1:1080"}
|
||||
for verdict in ("coherent", "no", "unmeasured"):
|
||||
session = InvisiblePlaywright(seed=7, binary_path="firefox")
|
||||
session._timezone, session._locale = "Asia/Tokyo", decide_session_locale("en-US")
|
||||
session._udp_exit = verdict
|
||||
prefs = session._build_prefs()
|
||||
assert prefs[UDP_EXIT_PREF] == verdict
|
||||
assert session_udp_exit(prefs) == verdict
|
||||
assert _udp_exit.launch_proxy_command(proxy, udp_exit=session_udp_exit(prefs))["udp"] == verdict
|
||||
rest, _seed, _budget = take_session_motion(prefs)
|
||||
assert UDP_EXIT_PREF not in rest, "the verdict must not be written into the profile"
|
||||
|
||||
|
||||
def test_a_session_that_measured_nothing_writes_no_verdict_and_the_proxy_is_unmeasured():
|
||||
from invisible_core import decide_session_locale
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
from invisible_playwright._juggler.server import UDP_EXIT_PREF, session_udp_exit
|
||||
session = InvisiblePlaywright(seed=7, binary_path="firefox")
|
||||
session._timezone, session._locale = "Asia/Tokyo", decide_session_locale("en-US")
|
||||
prefs = session._build_prefs()
|
||||
assert UDP_EXIT_PREF not in prefs and session_udp_exit(prefs) is None
|
||||
assert _udp_exit.launch_proxy_command({"server": "socks5://10.0.0.1:1080"}, udp_exit=session_udp_exit(prefs))["udp"] == "unmeasured"
|
||||
|
||||
|
||||
def test_a_caller_cannot_claim_a_verdict_among_its_own_prefs():
|
||||
from invisible_core import decide_session_locale
|
||||
from invisible_playwright import InvisiblePlaywright
|
||||
from invisible_playwright._juggler.server import UDP_EXIT_PREF, session_udp_exit
|
||||
session = InvisiblePlaywright(seed=7, binary_path="firefox", extra_prefs={UDP_EXIT_PREF: "coherent"})
|
||||
session._timezone, session._locale = "Asia/Tokyo", decide_session_locale("en-US")
|
||||
assert UDP_EXIT_PREF not in session._build_prefs(), "a verdict nobody measured travelled to the server"
|
||||
session._udp_exit = "no"
|
||||
assert session._build_prefs()[UDP_EXIT_PREF] == "no"
|
||||
assert session_udp_exit({UDP_EXIT_PREF: "yes"}) is None, "a value the core does not declare is not read"
|
||||
|
||||
|
||||
def test_every_entry_point_keeps_the_verdict_of_its_geo_step():
|
||||
import importlib
|
||||
import inspect
|
||||
for module in ("launcher", "async_api", "_juggler.remote", "_session"):
|
||||
source = inspect.getsource(importlib.import_module("invisible_playwright." + module))
|
||||
assert "._udp_exit = " in source and ".udp_exit" in source, module
|
||||
|
||||
@@ -39,7 +39,7 @@ def display(monkeypatch):
|
||||
vd = RecordingDisplay()
|
||||
geo = types.SimpleNamespace(timezone="Europe/Rome",
|
||||
locale=SessionLocale.of("it-IT"),
|
||||
egress_ip=None,
|
||||
egress_ip=None, udp_exit=None,
|
||||
geolocation_override=lambda: None)
|
||||
|
||||
def refuse(**_kw):
|
||||
|
||||
@@ -90,7 +90,7 @@ def test_behind_a_socks5_proxy_that_cannot_carry_the_udp_nothing_is_sent_direct(
|
||||
try:
|
||||
monkeypatch.setattr(_geo, "discover_egress_ip", egress_by_proxy(gateway))
|
||||
found = _gather(lambda: _launch_behind(gateway, binary_path=binary), witness)
|
||||
assert declared_udp(gateway.proxy, measure_servers(gateway)) == declared, "the scenario is not the one it says"
|
||||
assert declared_udp(gateway.proxy) == declared, "the scenario is not the one it says"
|
||||
finally:
|
||||
gateway.close()
|
||||
leaked = witness.heard_from_other_than([EXIT_ADDRESS])
|
||||
@@ -143,7 +143,7 @@ def test_the_control_behind_a_coherent_gateway_the_witness_hears_the_exit_only(m
|
||||
try:
|
||||
monkeypatch.setattr(_geo, "discover_egress_ip", egress_by_proxy(gateway))
|
||||
_gather(lambda: _launch_behind(gateway, binary_path=binary), witness)
|
||||
assert declared_udp(gateway.proxy, measure_servers(gateway)) == "coherent"
|
||||
assert declared_udp(gateway.proxy) == "coherent"
|
||||
finally:
|
||||
gateway.close()
|
||||
heard = witness.heard()
|
||||
|
||||
+10
-8
@@ -9,8 +9,8 @@ from invisible_playwright import cli
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _fetch_does_not_download_the_intermediates(monkeypatch):
|
||||
"""`fetch` also makes the core's intermediates list present (`ensure_intermediates`), which reaches Mozilla on a cold cache: a test that is not about it does not."""
|
||||
monkeypatch.setattr("invisible_playwright.cli.ensure_intermediates", lambda *a, **k: None)
|
||||
"""`fetch` also looks for a newer intermediates list (`update_intermediates`), which reaches Mozilla: a test that is not about it does not."""
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_intermediates", lambda *a, **k: (None, False), raising=False)
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
@@ -105,20 +105,22 @@ def test_fetch_prints_the_path_as_its_last_line(tmp_path, monkeypatch, capsys):
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_fetch_makes_the_intermediates_list_present_after_the_engine(tmp_path, monkeypatch, capsys):
|
||||
"""The known-bad is a `fetch` that leaves the first launch to download the core's intermediates list in line: the engine is made present, then the list,
|
||||
in that order, and the path of the engine is still the last line."""
|
||||
def test_fetch_looks_for_a_newer_intermediates_list_after_the_engine(tmp_path, monkeypatch, capsys):
|
||||
"""The known-bad is a `fetch` that only makes sure a list is cached (`ensure_intermediates`, no request on a warm cache): a user who runs `fetch` asking for
|
||||
what is current keeps a stale list. The engine is made present, then `update_intermediates` is called (and `ensure_intermediates` is not), in that
|
||||
order, and the path of the engine is still the last line."""
|
||||
fake = tmp_path / "firefox.exe"
|
||||
fake.write_text("x")
|
||||
calls = []
|
||||
monkeypatch.setattr("invisible_playwright.cli.ensure_binary", lambda: calls.append("engine") or fake)
|
||||
monkeypatch.setattr("invisible_playwright.cli.ensure_intermediates", lambda *a, **k: calls.append("intermediates"))
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_intermediates", lambda *a, **k: calls.append("update") or (None, False), raising=False)
|
||||
monkeypatch.setattr("invisible_playwright.cli.ensure_intermediates", lambda *a, **k: calls.append("ensure"), raising=False)
|
||||
monkeypatch.setattr("invisible_core.download.iter_cached_engines", lambda: [])
|
||||
|
||||
rc = cli.main(["fetch"])
|
||||
|
||||
assert rc == 0
|
||||
assert calls == ["engine", "intermediates"]
|
||||
assert calls == ["engine", "update"]
|
||||
assert capsys.readouterr().out.strip().splitlines()[-1] == str(fake)
|
||||
|
||||
|
||||
@@ -131,7 +133,7 @@ def test_a_failing_intermediates_list_is_a_warning_and_changes_neither_the_exit_
|
||||
raise RuntimeError("no route to host")
|
||||
|
||||
monkeypatch.setattr("invisible_playwright.cli.ensure_binary", lambda: fake)
|
||||
monkeypatch.setattr("invisible_playwright.cli.ensure_intermediates", refuses)
|
||||
monkeypatch.setattr("invisible_playwright.cli.update_intermediates", refuses)
|
||||
monkeypatch.setattr("invisible_core.download.iter_cached_engines", lambda: [])
|
||||
|
||||
rc = cli.main(["fetch"])
|
||||
|
||||
@@ -155,7 +155,7 @@ def test_a_page_behind_a_gateway_that_relays_udp_starts_on_h2_reaches_h3_within_
|
||||
protocols, walls = _visits("socks5_coherent", server, monkeypatch, egress_by_proxy(gateway), proxy=gateway.proxy,
|
||||
udp_stun_servers=measure_servers(gateway))
|
||||
carried = [(h, p) for h, p, _data in gateway.datagrams if (h, p) == (host, server.port)]
|
||||
declared = declared_udp(gateway.proxy, measure_servers(gateway))
|
||||
declared = declared_udp(gateway.proxy)
|
||||
said = _report("socks5_coherent", protocols, walls, server, gateway)
|
||||
assert declared == "coherent", "the core measured the gateway %s, not coherent: the engine would not use its relay. %s" % (declared, said)
|
||||
problems = judge_visits("socks5_coherent", protocols, walls)
|
||||
@@ -180,7 +180,7 @@ def test_a_page_behind_a_socks5_proxy_that_is_not_coherent_reads_h2_on_every_vis
|
||||
protocols, walls = _visits(road, server, monkeypatch, egress_by_proxy(gateway), proxy=gateway.proxy,
|
||||
udp_stun_servers=measure_servers(gateway))
|
||||
to_the_server = [(h, p) for h, p, _data in gateway.datagrams if (h, p) == (host, server.port)]
|
||||
declared = declared_udp(gateway.proxy, measure_servers(gateway))
|
||||
declared = declared_udp(gateway.proxy)
|
||||
said = _report(road, protocols, walls, server, gateway)
|
||||
assert declared == _DECLARED[road], "the core declared udp=%s, the road is %s. %s" % (declared, _DECLARED[road], said)
|
||||
problems = judge_visits(road, protocols, walls)
|
||||
|
||||
@@ -26,7 +26,6 @@ from invisible_core.seal import (
|
||||
DEFAULT_ENTRY_REL,
|
||||
JUGGLER_ENTRIES,
|
||||
EngineMismatch,
|
||||
_reset_active_seal_for_tests,
|
||||
)
|
||||
from invisible_playwright import _engine
|
||||
|
||||
@@ -79,9 +78,7 @@ def active(tmp_path, monkeypatch):
|
||||
"playwright": {"min": "1.55.0", "max": "1.61.0"}, "assets": {},
|
||||
}, sort_keys=True), encoding="utf-8")
|
||||
monkeypatch.setenv("INVISIBLE_SEAL_FILE", str(p))
|
||||
_reset_active_seal_for_tests()
|
||||
yield p
|
||||
_reset_active_seal_for_tests()
|
||||
yield p # the core reads the seal on every call: nothing to reset on the way in or out
|
||||
|
||||
|
||||
def test_sealed_tree_is_accepted(tmp_path, active):
|
||||
|
||||
@@ -17,7 +17,7 @@ import json
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_core.seal import _reset_active_seal_for_tests, load_seal
|
||||
from invisible_core.seal import load_seal
|
||||
from invisible_playwright import _engine
|
||||
|
||||
|
||||
@@ -29,10 +29,8 @@ def sealed_range(tmp_path, monkeypatch):
|
||||
"build_id": "20260724001949", "source_commit": "",
|
||||
"playwright": {"min": "1.55.0", "max": "1.61.0"}, "assets": {},
|
||||
}, sort_keys=True), encoding="utf-8")
|
||||
monkeypatch.setenv("INVISIBLE_SEAL_FILE", str(p))
|
||||
_reset_active_seal_for_tests()
|
||||
monkeypatch.setenv("INVISIBLE_SEAL_FILE", str(p)) # the core reads the seal on every call: nothing to reset
|
||||
yield load_seal(p)
|
||||
_reset_active_seal_for_tests()
|
||||
|
||||
|
||||
def set_reported_version(monkeypatch, value: str) -> None:
|
||||
@@ -76,8 +74,4 @@ def test_skew_can_be_allowed_explicitly_and_still_warns(sealed_range, monkeypatc
|
||||
def test_the_installed_client_satisfies_the_packaged_seal():
|
||||
"""The range the package ships must accept the client the package pins, or
|
||||
every fresh install is dead on arrival, which is L1."""
|
||||
_reset_active_seal_for_tests()
|
||||
try:
|
||||
_engine.assert_playwright_range()
|
||||
finally:
|
||||
_reset_active_seal_for_tests()
|
||||
_engine.assert_playwright_range()
|
||||
@@ -21,7 +21,7 @@ import json
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_core.seal import EngineMismatch, _reset_active_seal_for_tests
|
||||
from invisible_core.seal import EngineMismatch
|
||||
from invisible_playwright import _engine
|
||||
|
||||
|
||||
@@ -40,10 +40,8 @@ def sealed(tmp_path, monkeypatch):
|
||||
"build_id": "20260724001949", "source_commit": "",
|
||||
"playwright": {"min": "1.55.0", "max": "1.61.0"}, "assets": {},
|
||||
}, sort_keys=True), encoding="utf-8")
|
||||
monkeypatch.setenv("INVISIBLE_SEAL_FILE", str(p))
|
||||
_reset_active_seal_for_tests()
|
||||
monkeypatch.setenv("INVISIBLE_SEAL_FILE", str(p)) # the core reads the seal on every call: nothing to reset
|
||||
yield
|
||||
_reset_active_seal_for_tests()
|
||||
|
||||
|
||||
def test_the_sealed_engine_reports_the_sealed_version(sealed):
|
||||
|
||||
@@ -185,4 +185,4 @@ def test_a_core_measure_that_is_not_coherent_is_said_outright_with_the_round_tri
|
||||
|
||||
|
||||
def test_what_the_core_declared_is_absent_not_an_error_when_it_measured_nothing():
|
||||
assert declared_udp_or_absent({"server": "socks5://127.0.0.1:1"}, ["198.51.100.6:19302"]) is None
|
||||
assert declared_udp_or_absent({"server": "socks5://127.0.0.1:1"}) is None
|
||||
@@ -22,11 +22,6 @@ from invisible_core import _geo, _udp_exit
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _fresh(monkeypatch):
|
||||
monkeypatch.setattr(_udp_exit, "_cache", {})
|
||||
|
||||
|
||||
def test_the_measure_servers_are_ip_port_ipv4_literals_that_the_core_takes():
|
||||
for gateway in (coherent(), tcp_only(), mismatched(), silent_udp()):
|
||||
with gateway:
|
||||
@@ -101,13 +96,16 @@ def test_each_proxy_has_the_tcp_exit_of_its_own_gateway():
|
||||
assert egress_by_proxy(first, direct="192.0.2.9")(None) == "192.0.2.9"
|
||||
|
||||
|
||||
def test_what_the_launch_declared_is_what_the_core_measured_and_an_absent_measurement_is_not_unmeasured(monkeypatch):
|
||||
def test_what_the_launch_declared_is_what_the_core_rendered_and_an_absent_declaration_is_not_unmeasured(monkeypatch):
|
||||
with silent_udp() as mute, coherent(exit_ip="198.51.100.77") as good:
|
||||
monkeypatch.setattr(_geo, "discover_egress_ip", egress_by_proxy(mute, good))
|
||||
with pytest.raises(AssertionError):
|
||||
declared_udp(mute.proxy, measure_servers(mute)) # nothing measured yet
|
||||
assert _udp_exit.measure_proxy_udp(good.proxy, measure_servers(good)) == "coherent"
|
||||
assert declared_udp(good.proxy, measure_servers(good)) == "coherent"
|
||||
# a measurement the launch made with ANOTHER list is not this one
|
||||
declared_udp(mute.proxy) # nothing declared yet
|
||||
assert _udp_exit.context_proxy_command(good.proxy, measure_servers(good))["udp"] == "coherent"
|
||||
assert declared_udp(good.proxy) == "coherent"
|
||||
# a declaration made for ANOTHER proxy is not this one
|
||||
with pytest.raises(AssertionError):
|
||||
declared_udp(good.proxy, ["198.51.100.8:3478"])
|
||||
declared_udp(mute.proxy)
|
||||
# the launch's way: a verdict handed over is the one declared, and the last one wins
|
||||
_udp_exit.launch_proxy_command(good.proxy, udp_exit="no")
|
||||
assert declared_udp(good.proxy) == "no"
|
||||
@@ -157,7 +157,7 @@ def _walk(gateway, firefox_binary, engine_at_least, prefs):
|
||||
allocated_at = gateway.turn.allocations[0][3] - t0 if gateway.turn.allocations else None
|
||||
held_starts = [a[0] for a in associations if a[0] >= held_from]
|
||||
auth = gateway.user is not None
|
||||
declared = declared_udp(gateway.proxy, measure_servers(gateway))
|
||||
declared = declared_udp(gateway.proxy)
|
||||
assert declared == "coherent", "the core did not measure the chain's UDP coherent (%s): the engine would not use the relay" % declared + gateway.explain(result)
|
||||
ok = result.get("status") == "DONE" and gateway.page.verdicts and gateway.page.verdicts[-1]["ok"]
|
||||
assert ok, "the page did not get a server-reflexive candidate that the TURN server saw (the page was waited for 30 s):" + gateway.explain(result)
|
||||
|
||||
@@ -50,7 +50,7 @@ def slow(monkeypatch):
|
||||
vd = SlowDisplay()
|
||||
geo = types.SimpleNamespace(timezone="Europe/Rome",
|
||||
locale=SessionLocale.of("it-IT"),
|
||||
egress_ip=None,
|
||||
egress_ip=None, udp_exit=None,
|
||||
geolocation_override=lambda: None)
|
||||
|
||||
def refuse(**_kw):
|
||||
|
||||
@@ -453,7 +453,7 @@ def _gather_behind_a_coherent_gateway(monkeypatch, credentials, ice_prefs, rtt_m
|
||||
associates = gateway.associates
|
||||
# What the bench saw, taken before the gateway closes: its send errors, CONNECTs, accepted connections, associations and the
|
||||
# datagrams with their times, and what the core declared for this proxy (absent when its measure never finished).
|
||||
bench = bench_report(gateway, rtt_ms, declared_udp_or_absent(gateway.proxy, measure_servers(gateway)))
|
||||
bench = bench_report(gateway, rtt_ms, declared_udp_or_absent(gateway.proxy))
|
||||
srflx = [c for c in srflx_candidates(candidates(res["candidates"])) if c["address"] == exit_ip]
|
||||
verdict = (f"srflx with the gateway's exit {exit_ip}: {srflx}; candidates: {res['candidates']}; "
|
||||
f"ICE errors: {res['errors']}; gather timings (ms from the offer): {res['at_ms']}; "
|
||||
@@ -714,7 +714,7 @@ def _gather_where_the_udp_is_dropped(gateway, monkeypatch, measured):
|
||||
page.goto("about:blank")
|
||||
res = page.evaluate(_RELAY_PROBE_JS, stun)
|
||||
carried = [(host, port) for host, port, _payload in gateway.datagrams]
|
||||
declared = declared_udp(gateway.proxy, measure_servers(gateway))
|
||||
declared = declared_udp(gateway.proxy)
|
||||
assert declared == measured, f"the core declared udp={declared} for this proxy, the measurement is {measured}"
|
||||
assert (STUN_NUMBER, STUN_PORT) not in carried, (
|
||||
f"the engine sent the page's UDP to a relay that was not measured coherent: {carried}")
|
||||
|
||||
Reference in new issue
Block a user