ci: a visit of the HTTPS and HTTP/3 walks is left only after its origin's favicon is served and the page is network-idle
A/A run 45189518824 (Linux): in one run the second visit of the HTTP/3 page asked for /favicon.ico, in the other it did not. Over 14 transcripts of the day Firefox asks once per origin of a launch: in the journey on the first page of each origin (140 of 140), on no page of the other steps (0 of 980), and in the walks ?v=1 always asks while ?v=2 does not (59 and 60 of 60). Hypothesis, not proved: the goto of ?v=2 races the recording of ?v=1's favicon. - settle_visit, the one point a visit is left from: the favicon of the page's origin has been asked for and served in full (WireServer.answered_at, marked after the last byte on http1, h2 and h3), then the page reaches networkidle. Each wait has the 120 s hang guard; one that reaches it is an error of the transcript that names the visit and the missing wait. - The evidence of the transcript keeps the arrival and the end of the answer of the HTTP/3 requests, for the measure to make if this falls again. The journey is not touched. - Unit rows 3443/3444.
This commit is contained in:
1 parent
2e2ce133df
commit
1adc3f3ccf
6 files changed
+346
-15
No files matched your search
@@ -14,8 +14,8 @@
|
||||
{"id": "wrapper.e2e.fakeweb", "giro": "G2", "os": ["linux", "windows"], "min_tests": 7, "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: every step as stock, and every page left only once its noise is done), each judged against what stock Firefox does, as tests/fakeweb/pages.json declares it. 7 = 3 + 4 (the last two: a `load` that takes 20 s is a step that succeeds, and a `load` that never comes ends in an error that names the wait and the page). 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": 3431, "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_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.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_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.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_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.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_host_gate_ab.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_poison_host.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_suite_run.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_argument_reaches_the_page_as_playwright_sends_it.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_every_wire_method_is_served_or_refused.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_glean_ready.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.pyLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 3432, "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_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.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_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.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_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.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_host_gate_ab.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_poison_host.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_suite_run.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_argument_reaches_the_page_as_playwright_sends_it.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_every_wire_method_is_served_or_refused.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_glean_ready.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_transportLine truncated
|
||||
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 3443, "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_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.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_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.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_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.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_host_gate_ab.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_poison_host.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_suite_run.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_argument_reaches_the_page_as_playwright_sends_it.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_every_wire_method_is_served_or_refused.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_glean_ready.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.pyLine truncated
|
||||
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 3444, "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_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.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_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.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_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_oracle.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.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_host_gate_ab.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_poison_host.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_suite_run.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_argument_reaches_the_page_as_playwright_sends_it.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_every_wire_method_is_served_or_refused.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_glean_ready.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_transportLine 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)."},
|
||||
{"id": "wrapper.e2e.suite.linux.1", "giro": "G2", "os": ["linux"], "min_tests": 415, "exact": true, "tests": ["tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_declared_host_network_e2e.py", "tests/test_detectors_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_element_screenshot_e2e.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_display_linux.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_ignore_https_errors_e2e.py", "tests/test_injected_node_surface.py", "tests/test_juggler_connection.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_navigation_response.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_oop_frame_element.py", "tests/test_oop_frame_geometry.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_screencast.py", "tests/test_screencast_stop_e2e.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_offline_e2e.py", "tests/test_shadow_trusted_input.py", "tests/test_strict_and_force.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_a_launch_scans_no_process_of_the_machine", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_after_close_no_process_of_the_session_is_left", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_ua_widget_not_selectable.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_webgl_draws_on_the_engine_s_own_gl_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_Line truncated
|
||||
{"id": "wrapper.e2e.suite.linux.2", "giro": "G2", "os": ["linux"], "min_tests": 414, "exact": true, "tests": ["tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_drag_motion.py", "tests/test_expose_binding_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_new_page_defaults.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_e2e.py", "tests/test_route_post_data_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screenshot_of_text_returns_linux_e2e.py", "tests/test_scroll_into_view.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_service_workers_blocked.py", "tests/test_set_input_files_payloads.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 564 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapLine truncated
|
||||
|
||||
@@ -98,6 +98,11 @@ H3_VISITS = 5
|
||||
#: The safety nets of a run, in seconds: a launch that does not come back, a run that does not end. Never a verdict.
|
||||
RUN_TIMEOUT_S = 40 * 60
|
||||
WAIT_S = 30
|
||||
#: The guard of the two waits that end a visit of the HTTPS and HTTP/3 walks (``settle_visit``): the deadline of a HANG, as ``profile_p4.HANG_GUARD_MS`` is for the journey
|
||||
#: (a test holds the two equal). A healthy browser reaches both far inside it; one that reaches it has stopped, and the visit says so as an error of the transcript.
|
||||
LEAVE_GUARD_MS = 120000
|
||||
#: The favicon of an origin: the one request the browser makes on its own, once per origin of a launch, that the pages of the walk do not ask for.
|
||||
FAVICON = "/favicon.ico"
|
||||
#: How many times a lab is made again when two of its servers share a port number.
|
||||
MAX_LAB_TRIES = 50
|
||||
#: Whose categories a transcript holds under each seed.
|
||||
@@ -1127,7 +1132,7 @@ def wire_summary(server: Any, phase: str, norm: Normalizer) -> Dict[str, Any]:
|
||||
item: Dict[str, Any] = {"alpn": c["alpn"], "tls": c["tls"]}
|
||||
if "h2" in c:
|
||||
h2 = dict(c["h2"])
|
||||
h2["requests"] = [{k: v for k, v in r.items() if k not in ("answered",)} for r in h2["requests"]]
|
||||
h2["requests"] = [{k: v for k, v in r.items() if k not in ("answered", "written_t")} for r in h2["requests"]]
|
||||
item["h2"] = h2
|
||||
if "http1" in c:
|
||||
item["http1"] = [{"request_line": r["request_line"], "headers": r["headers"], "body_length": r["body_length"]} for r in c["http1"]]
|
||||
@@ -1303,16 +1308,61 @@ def walk_journey(browser: Any, lab: Lab) -> Dict[str, Any]:
|
||||
return dict(journey_data(lab), steps=steps)
|
||||
|
||||
|
||||
def walk_https(browser: Any, lab: Lab, which: str, server: Any, name: str) -> Dict[str, Any]:
|
||||
#: How a visit and a walk are named in the error of a visit that cannot be left. In words, because ``guarded`` writes the first line of an error with every digit as ``N`` (a run's own numbers
|
||||
#: must not tell two runs apart): "v1" and "v2", "h1" and "h2" would come out the same.
|
||||
ORDINALS = ("first", "second", "third", "fourth", "fifth")
|
||||
WALK_NAMES = {"h1": "HTTP one", "h2": "HTTP two", "h3": "HTTP three"}
|
||||
|
||||
|
||||
def visit_name(which: str, visit: int) -> str:
|
||||
return "the %s visit of the %s walk" % (ORDINALS[visit - 1], WALK_NAMES[which])
|
||||
|
||||
|
||||
class VisitNotSettled(Exception):
|
||||
"""A visit of the HTTPS or HTTP/3 walk reached its guard before it could be left (``settle_visit``). The first line names the visit and the wait that did not end, and nothing
|
||||
that changes from run to run, so that two runs that stop at the same place say the same words."""
|
||||
|
||||
|
||||
def settle_visit(page: Any, server: Any, visit: str, pump: Callable[[], Any], guard_ms: int = LEAVE_GUARD_MS) -> None:
|
||||
"""The one point from which a visit of the HTTPS and HTTP/3 walks is left: before the next ``goto``, the snapshot of the wire and the close of the context.
|
||||
|
||||
(1) The favicon of the page's ORIGIN (``server``: one server is one origin) has been asked for AND served in full by the lab in this launch (``server.answered_at``: the request
|
||||
arrived and its answer was written to the last byte). A second visit of the same origin finds that already true and waits for nothing: the browser asks once per origin of a launch.
|
||||
(2) THEN the page reaches ``networkidle``: no request for 500 ms after the last answer, so after the favicon's too.
|
||||
Each wait has the guard; one that reaches it raises :class:`VisitNotSettled`, which says the visit (``visit_name``) and which of the two is missing (the walk's ``guarded`` makes it an ``error`` leaf
|
||||
of the transcript, red), and the walk does not go on in silence.
|
||||
|
||||
Why. A/A run 45189518824 (e2e, Linux): ``seeds/0/h3/wire/requests/*`` red, the second visit (``?v=2``) of the HTTP/3 page asked for ``/favicon.ico`` in the first run and not in the
|
||||
second. 14 transcripts of the day (runs 45118341246, 45121964904 Linux and Windows, 45153612447 Linux and Windows, 45176061220, 45189518824): Firefox asks for the favicon of an
|
||||
origin once per launch; in the journey only on the FIRST page of each origin (steps 01 and 10: 140 launches of 140 asked at both), on no page of the other steps (0 of 980) and on
|
||||
the last page of the walk (0 of 70). In ``walk_h3`` and ``walk_https`` (h1, h2) ``?v=1`` always asks; ``?v=2``, same origin, did not in 59 launches of 60 over HTTP/3 and in 60 of 60 over h1
|
||||
and h2. The one that did ask was the second one: NOT PROVED, the hypothesis is a race: the ``goto`` of ``?v=2`` leaves before the browser has recorded the result of the favicon
|
||||
of ``?v=1``, and a favicon that is still in flight is asked for again. If a red falls again with this wait in place the measure to make is, from ``wire_evidence`` (``h3`` and
|
||||
``https``: ``t`` the arrival and ``written`` the end of the answer, seconds from the start of each server), the moment the answer to the favicon of ``?v=1`` was written against the
|
||||
moment the ``goto`` of ``?v=2`` began (the ``t`` of its first request): written before it = the hypothesis is wrong and the cause is elsewhere."""
|
||||
from _waits import wait_until
|
||||
|
||||
guard_s = guard_ms / 1000
|
||||
if server.answered_at(FAVICON) is None and not wait_until(lambda: server.answered_at(FAVICON) is not None, guard_s, pump):
|
||||
raise VisitNotSettled("%s: the favicon of its origin was not served in full by the lab within %g s (guard)" % (visit, guard_s))
|
||||
try:
|
||||
page.wait_for_load_state("networkidle", timeout=guard_ms)
|
||||
except Exception as exc: # noqa: BLE001 - the client's own timeout, or a page that is gone: both mean the visit cannot be left
|
||||
raise VisitNotSettled("%s: networkidle was not reached within %g s (guard): %s" % (visit, guard_s, _first_line(exc))) from exc
|
||||
|
||||
|
||||
def walk_https(browser: Any, lab: Lab, which: str, server: Any, name: str, guard_ms: int = LEAVE_GUARD_MS) -> Dict[str, Any]:
|
||||
context = browser.new_context(ignore_https_errors=True)
|
||||
try:
|
||||
page = context.new_page()
|
||||
pump = lambda: page.wait_for_timeout(100) # noqa: E731
|
||||
out: Dict[str, Any] = {}
|
||||
for visit in (1, 2):
|
||||
phase = "https.%s.v%d" % (which, visit)
|
||||
lab.rec.set_phase(phase)
|
||||
page.goto("https://%s:%d/?v=%d" % (name, server.port, visit), wait_until="load", timeout=60000)
|
||||
page.evaluate(FETCH_JS)
|
||||
settle_visit(page, server, visit_name(which, visit), pump, guard_ms) # before the next visit enters its stage: the favicon of this one is this stage's
|
||||
out["v%d" % visit] = {"dns": phase_data(lab, phase)["dns"]}
|
||||
out["wire"] = fold_wire(wire_summary(server, "https.%s" % which, lab.norm)) # the whole walk, read once it is over: see fold_wire
|
||||
return out
|
||||
@@ -1320,7 +1370,7 @@ def walk_https(browser: Any, lab: Lab, which: str, server: Any, name: str) -> Di
|
||||
context.close()
|
||||
|
||||
|
||||
def walk_h3(browser: Any, lab: Lab) -> Dict[str, Any]:
|
||||
def walk_h3(browser: Any, lab: Lab, guard_ms: int = LEAVE_GUARD_MS) -> Dict[str, Any]:
|
||||
from _waits import wait_until
|
||||
|
||||
context = browser.new_context(ignore_https_errors=True)
|
||||
@@ -1336,6 +1386,7 @@ def walk_h3(browser: Any, lab: Lab) -> Dict[str, Any]:
|
||||
wait_until(lambda: bool(lab.h3.quic), WAIT_S, pump)
|
||||
out["quic_seen"] = bool(lab.h3.quic)
|
||||
protocol = page.evaluate(NAV_JS)
|
||||
settle_visit(page, lab.h3, visit_name("h3", visit), pump, guard_ms) # the favicon rides h2 or QUIC: the server reads it on both
|
||||
out["visits"].append(protocol)
|
||||
out["v%d" % visit] = {"dns": phase_data(lab, phase)["dns"]}
|
||||
if protocol == "h3" or not out["quic_seen"]:
|
||||
@@ -1452,12 +1503,19 @@ def wire_evidence(lab: Lab) -> Dict[str, Any]:
|
||||
for c in server.snapshot()["connections"]:
|
||||
item = {"id": c["id"], "t": c.get("t"), "phase": c["phase"], "alpn": c["alpn"], "resumed": _resumed(c["tls"] or {})}
|
||||
if "http1" in c:
|
||||
item["requests"] = [{"t": r.get("t"), "request": r["request_line"]} for r in c["http1"]]
|
||||
item["requests"] = [{"t": r.get("t"), "written": r.get("written_t"), "request": r["request_line"]} for r in c["http1"]]
|
||||
if "h2" in c:
|
||||
item["requests"] = len(c["h2"].get("requests") or [])
|
||||
connections.append(item)
|
||||
https[role] = connections
|
||||
return {"journey": journey, "https": https}
|
||||
# The requests of the HTTP/3 site over QUIC, with the moment each arrived and the moment its answer was written to the last datagram (``written``: ``settle_visit`` says what it
|
||||
# is for); both seconds since the HTTP/3 server started, as the ``t`` of an HTTP/1.1 request is since its own.
|
||||
h3 = []
|
||||
if lab.h3 is not None:
|
||||
for q in lab.h3.snapshot()["quic"]:
|
||||
h3.append({"phase": q["phase"], "requests": [{"t": r.get("t"), "written": r.get("written_t"),
|
||||
"request": "%s %s" % (dict(r["headers"]).get(":method"), lab.norm.text(dict(r["headers"]).get(":path", "")))} for r in q["requests"]]})
|
||||
return {"journey": journey, "https": https, "h3": h3}
|
||||
|
||||
|
||||
def sentinel_signature(lab: Lab) -> Dict[str, Any]:
|
||||
|
||||
+47
-7
@@ -363,10 +363,12 @@ class Http1Parser:
|
||||
|
||||
|
||||
def serve_http1(sock: Any, responder: Callable[[Dict[str, Any]], Tuple[int, List[Tuple[str, str]], bytes]],
|
||||
on_request: Callable[[Dict[str, Any]], None], alt_svc: Optional[str] = None, close_after_response: bool = False) -> None:
|
||||
on_request: Callable[[Dict[str, Any]], None], alt_svc: Optional[str] = None, close_after_response: bool = False,
|
||||
on_answered: Optional[Callable[[Dict[str, Any]], None]] = None) -> None:
|
||||
"""Serve the requests of a connection (a TLS socket, or a plain one) until the peer closes: each request is handed to ``on_request`` and answered by
|
||||
``responder(request) -> (status, headers, body)``. With ``close_after_response`` the answer says ``Connection: close`` and the connection ends after it: the client
|
||||
needs a new connection for its next request, and by then it has read the session ticket the server sent with the first answer."""
|
||||
needs a new connection for its next request, and by then it has read the session ticket the server sent with the first answer. ``on_answered(request)`` is called once the
|
||||
whole answer (head and body) has been handed to the socket, in the same thread and before the next request is read: the moment a client can have all of it."""
|
||||
parser = Http1Parser()
|
||||
while True:
|
||||
data = sock.recv(65536)
|
||||
@@ -383,6 +385,8 @@ def serve_http1(sock: Any, responder: Callable[[Dict[str, Any]], Tuple[int, List
|
||||
if close_after_response:
|
||||
lines.append("Connection: close")
|
||||
sock.sendall(("\r\n".join(lines) + "\r\n\r\n").encode("latin-1") + body)
|
||||
if on_answered is not None:
|
||||
on_answered(request)
|
||||
if close_after_response:
|
||||
return
|
||||
|
||||
@@ -476,7 +480,8 @@ class H2Connection:
|
||||
"""The server side of one HTTP/2 connection, with a tap on the frames. ``serve(sock)`` blocks until the peer closes. Each request is recorded as
|
||||
``{"stream", "pseudo_order": [":method", ...], "header_names": [...], "headers": [[name, value], ...], "end_stream"}`` and answered by ``responder``."""
|
||||
|
||||
def __init__(self, responder: Callable[[Dict[str, Any]], Tuple[int, List[Tuple[str, str]], bytes]], alt_svc: Optional[str] = None) -> None:
|
||||
def __init__(self, responder: Callable[[Dict[str, Any]], Tuple[int, List[Tuple[str, str]], bytes]], alt_svc: Optional[str] = None,
|
||||
clock: Callable[[], float] = time.monotonic) -> None:
|
||||
import h2.config
|
||||
import h2.connection
|
||||
|
||||
@@ -488,6 +493,9 @@ class H2Connection:
|
||||
self.tap = FrameTap()
|
||||
self.requests: List[Dict[str, Any]] = []
|
||||
self._bodies: Dict[int, int] = {}
|
||||
#: ``clock()`` is stamped on a request as ``written_t`` once its whole answer (headers, body, end of stream) has been written to the socket; the answers waiting for that are here.
|
||||
self._clock = clock
|
||||
self._unwritten: List[Dict[str, Any]] = []
|
||||
|
||||
def summary(self) -> Dict[str, Any]:
|
||||
return dict(summarize_frames(self.tap.frames), requests=list(self.requests))
|
||||
@@ -525,6 +533,9 @@ class H2Connection:
|
||||
out = self.conn.data_to_send()
|
||||
if out:
|
||||
sock.sendall(out)
|
||||
for request in self._unwritten:
|
||||
request["written_t"] = round(self._clock(), 3)
|
||||
self._unwritten.clear()
|
||||
|
||||
def _request(self, event: Any) -> None:
|
||||
headers = [[_text(n), _text(v)] for n, v in event.headers]
|
||||
@@ -537,6 +548,7 @@ class H2Connection:
|
||||
if request is None:
|
||||
return
|
||||
request["answered"] = True
|
||||
self._unwritten.append(request)
|
||||
fields = {n: v for n, v in request["headers"]}
|
||||
status, headers, body = self.responder({"method": fields.get(":method", ""), "target": fields.get(":path", ""), "headers": request["headers"],
|
||||
"scheme": "https", "protocol": "h2", "body_length": self._bodies.get(stream_id, 0)})
|
||||
@@ -687,11 +699,20 @@ class WireServer:
|
||||
record["alpn"] = tls.selected_alpn_protocol() or "http/1.1"
|
||||
tls.settimeout(60)
|
||||
if record["alpn"] == "h2":
|
||||
record["h2"] = connection = H2Connection(self.responder, self.alt_svc)
|
||||
record["h2"] = connection = H2Connection(self.responder, self.alt_svc, clock=self._now)
|
||||
connection.serve(tls)
|
||||
else:
|
||||
record["http1"] = []
|
||||
serve_http1(tls, self.responder, lambda r: record["http1"].append(dict(r, phase=self.phase(), t=self._now())), self.alt_svc, self.close_after_response)
|
||||
arrived: List[Dict[str, Any]] = [] # the request being answered: a connection serves one at a time, and the mark goes on the record kept for it
|
||||
|
||||
def on_request(r: Dict[str, Any]) -> None:
|
||||
arrived[:] = [dict(r, phase=self.phase(), t=self._now())]
|
||||
record["http1"].append(arrived[0])
|
||||
|
||||
def on_answered(_request: Dict[str, Any]) -> None:
|
||||
arrived[0]["written_t"] = self._now()
|
||||
|
||||
serve_http1(tls, self.responder, on_request, self.alt_svc, self.close_after_response, on_answered)
|
||||
except (ssl.SSLError, OSError, ConnectionError, NotAClientHello, TimeoutError) as exc:
|
||||
record["error"] = "%s: %s" % (type(exc).__name__, exc)
|
||||
finally:
|
||||
@@ -740,10 +761,11 @@ class WireServer:
|
||||
if isinstance(http_event, HeadersReceived):
|
||||
headers = [[_text(n), _text(v)] for n, v in http_event.headers]
|
||||
self._record["h3_settings"] = h3_settings(self._http.received_settings)
|
||||
self._record["requests"].append({
|
||||
request = {
|
||||
"stream": http_event.stream_id, "pseudo_order": [n for n, _v in headers if n.startswith(":")],
|
||||
"header_names": [n for n, _v in headers if not n.startswith(":")], "headers": headers,
|
||||
"phase": server.phase()})
|
||||
"phase": server.phase(), "t": server._now()}
|
||||
self._record["requests"].append(request)
|
||||
fields = dict(headers)
|
||||
status, out, body = server.responder({"method": fields.get(":method", ""), "target": fields.get(":path", ""), "headers": headers,
|
||||
"scheme": "https", "protocol": "h3", "body_length": 0})
|
||||
@@ -752,6 +774,7 @@ class WireServer:
|
||||
[(b"content-length", str(len(body)).encode())])
|
||||
self._http.send_data(http_event.stream_id, body, end_stream=True)
|
||||
self.transmit()
|
||||
request["written_t"] = server._now() # the datagrams that carry the whole answer have left the socket
|
||||
|
||||
configuration = QuicConfiguration(is_client=False, alpn_protocols=H3_ALPN)
|
||||
configuration.load_cert_chain(str(certificate), str(key))
|
||||
@@ -779,6 +802,23 @@ class WireServer:
|
||||
raise RuntimeError("the QUIC server did not start")
|
||||
|
||||
# --- what a test or the oracle reads --------------------------------------------------------------------------------------------------
|
||||
def answered_at(self, path: str) -> Optional[float]:
|
||||
"""When the server finished WRITING the answer to a request for ``path`` (the query is not part of it), whatever the transport it rode: seconds since the server started
|
||||
(the scale of ``t``), or None while no such request has been answered in full. A request that has arrived but whose answer is not all written is not answered: the mark is
|
||||
stamped after the last byte (HTTP/1.1, HTTP/2) or the last datagram (HTTP/3) is handed to the socket, in the one place that writes it."""
|
||||
with self._lock:
|
||||
connections = list(self.connections)
|
||||
quic = list(self.quic)
|
||||
marks: List[float] = []
|
||||
for c in connections:
|
||||
requests = [(r["target"], r) for r in list(c.get("http1") or [])]
|
||||
if "h2" in c:
|
||||
requests += [(dict(r["headers"]).get(":path", ""), r) for r in list(c["h2"].requests)]
|
||||
marks += [r["written_t"] for target, r in requests if target.split("?")[0] == path and "written_t" in r]
|
||||
for q in quic:
|
||||
marks += [r["written_t"] for r in list(q["requests"]) if dict(r["headers"]).get(":path", "").split("?")[0] == path and "written_t" in r]
|
||||
return min(marks) if marks else None
|
||||
|
||||
def snapshot(self) -> Dict[str, Any]:
|
||||
with self._lock:
|
||||
connections = list(self.connections)
|
||||
|
||||
+145
-1
@@ -577,7 +577,7 @@ def _h3_run(visits, message="quic-short"):
|
||||
|
||||
rec = ab.Recorder()
|
||||
rec.attach("doh", [])
|
||||
lab = SimpleNamespace(rec=rec, norm=ab.Normalizer({}), h3=SimpleNamespace(port=5, quic=[object()]))
|
||||
lab = SimpleNamespace(rec=rec, norm=ab.Normalizer({}), h3=SimpleNamespace(port=5, quic=[object()], answered_at=lambda path: 0.5))
|
||||
state = {"visit": 0}
|
||||
|
||||
class Page:
|
||||
@@ -592,6 +592,9 @@ def _h3_run(visits, message="quic-short"):
|
||||
def wait_for_timeout(self, ms):
|
||||
pass
|
||||
|
||||
def wait_for_load_state(self, state, timeout=None):
|
||||
pass
|
||||
|
||||
class Context:
|
||||
def new_page(self):
|
||||
return Page()
|
||||
@@ -608,6 +611,147 @@ def _h3_run(visits, message="quic-short"):
|
||||
ab.wire_summary = original
|
||||
|
||||
|
||||
class _FaviconServer:
|
||||
"""The lab server of a walk as ``settle_visit`` reads it: it has served the favicon once ``serve_after`` seconds have passed since the first look at it (a timer thread, as the real one is
|
||||
another thread), or never (``serve_after=None``)."""
|
||||
|
||||
def __init__(self, log, serve_after=0.0):
|
||||
import threading
|
||||
|
||||
self.log, self.serve_after, self.port, self.quic = log, serve_after, 5, [object()]
|
||||
self.served = threading.Event()
|
||||
self._started = False
|
||||
|
||||
def answered_at(self, path):
|
||||
import threading
|
||||
|
||||
assert path == ab.FAVICON
|
||||
if not self._started and self.serve_after is not None:
|
||||
self._started = True
|
||||
threading.Timer(self.serve_after, self._serve).start()
|
||||
return 0.25 if self.served.is_set() else None
|
||||
|
||||
def _serve(self):
|
||||
self.log.append("favicon served")
|
||||
self.served.set()
|
||||
|
||||
|
||||
def _visits(monkeypatch, kind, serve_after=0.0, guard_ms=60000, idle_error=False):
|
||||
"""``ab.walk_https`` or ``ab.walk_h3`` against a fake page and a fake lab server that write what they are asked, in order, to ``log``: ``(log, outcome)``, the outcome being what ``guarded``
|
||||
makes of the walk. The page is read over HTTP/3 at its second visit, which ends the HTTP/3 walk."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
log = []
|
||||
rec = ab.Recorder()
|
||||
rec.attach("doh", [])
|
||||
server = _FaviconServer(log, serve_after)
|
||||
lab = SimpleNamespace(rec=rec, norm=ab.Normalizer({}), h3=server)
|
||||
monkeypatch.setattr(ab, "phase_data", lambda lab_, phase: log.append("phase_data %s" % phase) or {"dns": {}, "udp": {"counts": {}}})
|
||||
monkeypatch.setattr(ab, "wire_summary", lambda *a, **k: log.append("wire_summary") or {"connections": [], "quic": []})
|
||||
visit = {"n": 0}
|
||||
|
||||
class Page:
|
||||
def goto(self, url, **options):
|
||||
visit["n"] += 1
|
||||
log.append("goto %s" % url.split("/")[-1])
|
||||
|
||||
def evaluate(self, script):
|
||||
return "h3" if visit["n"] == 2 else "h2"
|
||||
|
||||
def wait_for_timeout(self, ms):
|
||||
log.append("pump")
|
||||
time.sleep(ms / 1000)
|
||||
|
||||
def wait_for_load_state(self, state, timeout=None):
|
||||
assert state == "networkidle" and timeout == guard_ms
|
||||
if idle_error:
|
||||
raise Exception("Timeout %dms exceeded." % timeout)
|
||||
log.append("networkidle after the favicon" if server.served.is_set() else "networkidle BEFORE the favicon")
|
||||
|
||||
class Context:
|
||||
def new_page(self):
|
||||
return Page()
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
browser = SimpleNamespace(new_context=lambda **kw: Context())
|
||||
if kind == "h3":
|
||||
run = lambda: ab.walk_h3(browser, lab, guard_ms=guard_ms) # noqa: E731
|
||||
else:
|
||||
run = lambda: ab.walk_https(browser, lab, "h2", server, "h2.lab.test", guard_ms=guard_ms) # noqa: E731
|
||||
return log, ab.guarded(run)
|
||||
|
||||
|
||||
def test_the_leave_guard_of_the_oracle_is_the_one_of_the_journey():
|
||||
from fakeweb import profile_p4
|
||||
|
||||
assert ab.LEAVE_GUARD_MS == profile_p4.HANG_GUARD_MS == 120000
|
||||
|
||||
|
||||
def test_a_visit_waits_for_the_favicon_to_be_served_in_full_however_long_it_takes_and_then_for_the_network_to_be_idle(monkeypatch):
|
||||
"""A/A run 45189518824 (e2e, Linux): the second visit of the HTTP/3 page asked for the favicon in one run and not in the other (``seeds/0/h3/wire/requests/*``). A visit that is left
|
||||
before the favicon of its origin has been served leaves it to the next one."""
|
||||
for kind, phase in (("https", "https.h2.v1"), ("h3", "h3.v1")):
|
||||
log, outcome = _visits(monkeypatch, kind, serve_after=0.35)
|
||||
assert "error" not in outcome, outcome
|
||||
first = log[:log.index("phase_data %s" % phase)]
|
||||
assert "pump" in first, "the visit waited for the favicon"
|
||||
assert [e for e in first if e != "pump"] == ["goto ?v=1", "favicon served", "networkidle after the favicon"], first
|
||||
|
||||
|
||||
def test_the_order_of_a_visit_is_the_page_then_the_favicon_then_the_network_idle_then_the_snapshot_and_only_then_the_next_visit(monkeypatch):
|
||||
for kind, expected in (
|
||||
("https", ["goto ?v=1", "favicon served", "networkidle after the favicon", "phase_data https.h2.v1",
|
||||
"goto ?v=2", "networkidle after the favicon", "phase_data https.h2.v2", "wire_summary"]),
|
||||
("h3", ["goto ?v=1", "favicon served", "networkidle after the favicon", "phase_data h3.v1",
|
||||
"goto ?v=2", "networkidle after the favicon", "phase_data h3.v2", "wire_summary", "phase_data h3"]),
|
||||
):
|
||||
log, outcome = _visits(monkeypatch, kind, serve_after=0.15)
|
||||
assert "error" not in outcome, outcome
|
||||
assert [e for e in log if e != "pump"] == expected
|
||||
|
||||
|
||||
def test_a_second_visit_of_the_same_origin_finds_the_favicon_served_and_does_not_wait_for_it(monkeypatch):
|
||||
for kind in ("https", "h3"):
|
||||
log, outcome = _visits(monkeypatch, kind, serve_after=0.25)
|
||||
assert "error" not in outcome, outcome
|
||||
second = log[log.index("goto ?v=2"):]
|
||||
assert second[:3] == ["goto ?v=2", "networkidle after the favicon", second[2]] and second[2].startswith("phase_data"), second
|
||||
assert "pump" not in second, "the second visit waits only for the network to be idle"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind,visit", [("https", "the first visit of the HTTP two walk"), ("h3", "the first visit of the HTTP three walk")])
|
||||
def test_a_favicon_the_lab_never_serves_is_an_error_of_the_transcript_that_names_the_visit_and_the_favicon_and_the_walk_stops(monkeypatch, kind, visit):
|
||||
log, outcome = _visits(monkeypatch, kind, serve_after=None, guard_ms=300)
|
||||
assert list(outcome) == ["error"] and visit in outcome["error"] and "favicon" in outcome["error"] and "VisitNotSettled" in outcome["error"], outcome
|
||||
assert "networkidle" not in outcome["error"]
|
||||
assert not any(e.startswith(("phase_data", "networkidle", "goto ?v=2")) for e in log) and "wire_summary" not in log, log
|
||||
assert ab.transcript_errors({"0": {kind: outcome}}) == ["seeds/0/%s/error" % kind], "the red is a leaf the run itself reports"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind,visit", [("https", "the first visit of the HTTP two walk"), ("h3", "the first visit of the HTTP three walk")])
|
||||
def test_a_network_that_never_goes_idle_is_an_error_of_the_transcript_that_names_the_visit_and_networkidle_and_the_walk_stops(monkeypatch, kind, visit):
|
||||
log, outcome = _visits(monkeypatch, kind, serve_after=0.0, guard_ms=300, idle_error=True)
|
||||
assert list(outcome) == ["error"] and visit in outcome["error"] and "networkidle" in outcome["error"] and "favicon" not in outcome["error"], outcome
|
||||
assert "favicon served" in log, "the favicon was there: it is the second wait that did not end"
|
||||
assert not any(e.startswith(("phase_data", "goto ?v=2")) for e in log) and "wire_summary" not in log, log
|
||||
assert ab.transcript_errors({"0": {kind: outcome}}) == ["seeds/0/%s/error" % kind]
|
||||
|
||||
|
||||
def test_the_evidence_of_a_seed_keeps_the_moment_the_http3_requests_arrived_and_the_moment_their_answers_were_written():
|
||||
"""The measure to make if the red of the second visit falls again (``settle_visit`` says which): the moment the favicon of ``?v=1`` was written against the ``goto`` of ``?v=2``."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
quic = [{"phase": "h3.v1", "requests": [{"t": 1.5, "written_t": 1.75, "headers": [[":method", "GET"], [":path", "/favicon.ico"]]},
|
||||
{"t": 2.0, "headers": [[":method", "GET"], [":path", "/wire.css"]]}]}]
|
||||
lab = SimpleNamespace(rec=ab.Recorder(), norm=ab.Normalizer({}), h1=None, h2=None, h3=SimpleNamespace(snapshot=lambda: {"connections": [], "quic": quic}))
|
||||
lab.rec.attach("doh", [])
|
||||
evidence = ab.wire_evidence(lab)
|
||||
assert evidence["h3"] == [{"phase": "h3.v1", "requests": [{"t": 1.5, "written": 1.75, "request": "GET /favicon.ico"}, {"t": 2.0, "written": None, "request": "GET /wire.css"}]}]
|
||||
json.dumps(evidence)
|
||||
|
||||
|
||||
def test_the_datagrams_of_the_http3_walk_are_summarised_over_the_walk_and_by_kind_not_by_number():
|
||||
"""A/A runs 44946411675 and 44960767715: 12+8 and 13+7, 23 and 22, 16 and 25 datagrams for the same walk: how many QUIC sends follows its acknowledgements and timers."""
|
||||
one, two, more = _h3_run([12, 8]), _h3_run([13, 7]), _h3_run([13, 8])
|
||||
|
||||
@@ -12,6 +12,7 @@ import socket
|
||||
import ssl
|
||||
import struct
|
||||
import threading
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -343,3 +344,61 @@ def test_h3_settings_are_named_and_a_reserved_identifier_is_grease():
|
||||
assert wc.h3_settings(None) is None
|
||||
assert wc.h3_settings({1: 65536, 7: 20, 0x21 + 0x1F * 3: 0, 0x33: 1}) == [["QPACK_MAX_TABLE_CAPACITY", 65536], ["QPACK_BLOCKED_STREAMS", 20], ["GREASE", 0],
|
||||
["H3_DATAGRAM", 1]]
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------- when an answer is written in full
|
||||
def _held_responder(release: threading.Event):
|
||||
"""The default site, except that the answer to ``/wire.css`` is not given until ``release`` is set: the request has arrived and its answer is not written."""
|
||||
def responder(request):
|
||||
if request["target"].split("?")[0] == "/wire.css":
|
||||
release.wait(60)
|
||||
return wc.default_responder(request)
|
||||
return responder
|
||||
|
||||
|
||||
def _http1_get(server, target: bytes) -> bytes:
|
||||
with socket.create_connection((server.address, server.port), timeout=60) as raw:
|
||||
with _client_context(["http/1.1"]).wrap_socket(raw, server_hostname="wire.test") as tls:
|
||||
tls.sendall(b"GET " + target + b" HTTP/1.1\r\nHost: wire.test\r\n\r\n")
|
||||
tls.settimeout(60)
|
||||
reply = b""
|
||||
while b"p{color" not in reply:
|
||||
chunk = tls.recv(4096)
|
||||
assert chunk, "the connection closed before the answer: %r" % reply
|
||||
reply += chunk
|
||||
return reply
|
||||
|
||||
|
||||
def _arrived(server, kind: str):
|
||||
connections = server.snapshot()["connections"]
|
||||
return [r for c in connections for r in (c.get("http1") if kind == "http1" else c.get("h2", {}).get("requests")) or []]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", ["http1", "h2"])
|
||||
def test_a_request_is_answered_in_full_only_when_the_last_byte_of_its_answer_has_been_written_to_the_socket(kind):
|
||||
"""The visits of the oracle's walks are left only once the lab has SERVED the favicon in full (scripts/ci_ab_network.py ``settle_visit``): a server that says "answered" when the request arrives
|
||||
(before the answer is written) or never says it is red here. The path is read without its query."""
|
||||
from _waits import wait_until
|
||||
|
||||
release = threading.Event()
|
||||
alpn = ("http/1.1",) if kind == "http1" else ("h2", "http/1.1")
|
||||
with wc.WireServer(alpn=alpn, dns_names=("wire.test",), responder=_held_responder(release)) as server:
|
||||
replies = []
|
||||
client = (lambda: _http1_get(server, b"/wire.css?x=1")) if kind == "http1" else (lambda: _h2_client_exchange(server))
|
||||
thread = threading.Thread(target=lambda: replies.append(client()), daemon=True)
|
||||
thread.start()
|
||||
try:
|
||||
assert wait_until(lambda: _arrived(server, kind), 30, lambda: time.sleep(0.01)), "the request never arrived"
|
||||
assert server.answered_at("/wire.css") is None, "the request has arrived and its answer is not written"
|
||||
finally:
|
||||
release.set()
|
||||
thread.join(60)
|
||||
assert replies, "the client got no answer"
|
||||
# the client can hold the whole answer a moment before the server has stamped it (the stamp follows the write): the oracle waits for it too
|
||||
assert wait_until(lambda: server.answered_at("/wire.css") is not None, 30, lambda: time.sleep(0.01)), "the answer was never marked as written"
|
||||
written = server.answered_at("/wire.css")
|
||||
assert isinstance(written, float) and written >= 0
|
||||
if kind == "http1":
|
||||
(request,) = _arrived(server, kind)
|
||||
assert request["t"] <= written == request["written_t"]
|
||||
assert server.answered_at("/favicon.ico") is None, "a path nobody asked for is not answered"
|
||||
@@ -64,3 +64,33 @@ def test_a_quic_client_is_recorded_transport_parameters_settings_and_the_order_o
|
||||
assert request["pseudo_order"] == [":method", ":scheme", ":authority", ":path"]
|
||||
assert request["header_names"] == ["user-agent", "accept", "x-last"]
|
||||
assert [n for n, _v in request["headers"]][:4] == [":method", ":scheme", ":authority", ":path"]
|
||||
|
||||
|
||||
def test_an_http3_request_is_answered_in_full_only_when_the_datagrams_of_its_answer_have_left_and_it_keeps_the_moment_it_arrived():
|
||||
import threading
|
||||
import time
|
||||
|
||||
from _waits import wait_until
|
||||
|
||||
release = threading.Event()
|
||||
|
||||
def responder(request):
|
||||
release.wait(60) # the loop of the QUIC server is held here, which is what a request that has arrived and is not yet answered is
|
||||
return wc.default_responder(request)
|
||||
|
||||
with wc.WireServer(h3=True, responder=responder) as server:
|
||||
statuses = []
|
||||
thread = threading.Thread(target=lambda: statuses.append(asyncio.run(_get(server.port))), daemon=True)
|
||||
thread.start()
|
||||
try:
|
||||
assert wait_until(lambda: any(q["requests"] for q in server.snapshot()["quic"]), 30, lambda: time.sleep(0.01)), "the request never arrived"
|
||||
assert server.answered_at("/wire.css") is None, "the request has arrived and its answer is not written"
|
||||
finally:
|
||||
release.set()
|
||||
thread.join(60)
|
||||
assert statuses == [200]
|
||||
assert wait_until(lambda: server.answered_at("/wire.css") is not None, 30, lambda: time.sleep(0.01)), "the answer was never marked as written"
|
||||
written = server.answered_at("/wire.css")
|
||||
(connection,) = server.snapshot()["quic"]
|
||||
(request,) = connection["requests"]
|
||||
assert isinstance(written, float) and request["t"] <= written == request["written_t"]
|
||||
Reference in new issue
Block a user