Skip to content

Fix/actions

Fix/actions #367

GitHub Actions / 4 failed Aug 7, 2024 in 0s

24 passed, 1 failed and 1 skipped

Tests failed

❌ junit-report.xml

26 tests were completed in 690s with 24 passed, 1 failed and 1 skipped.

Test suite Passed Failed Skipped Time
pytest 24✅ 1❌ 1⚪ 690s

❌ pytest

test.test_http_instrumentation
  ❌ test_cache_hits_recorded
	http_params = <function http_params.<locals>.parameterize at 0x7f67b4ce9bc0>
  ✅ test_javascript_saving
  ✅ test_content_saving
test.test_task_manager
  ✅ test_failure_limit_reset
test.test_profile
  ✅ test_crash_during_init
  ✅ test_saving
  ✅ test_crash_profile
test.test_simple_commands
  ✅ test_dump_page_source_valid[headless]
  ✅ test_save_screenshot_valid[xvfb]
test.test_http_instrumentation.TestPOSTInstrument
  ✅ test_record_post_data_x_www_form_urlencoded
  ✅ test_record_post_data_text_plain
  ⚪ test_record_file_upload
test.test_js_instrument.TestJSInstrumentRecursiveProperties
  ✅ test_instrument_object
test.test_http_instrumentation.TestHTTPInstrument
  ✅ test_worker_script_requests
test.test_extension.TestExtension
  ✅ test_js_call_stack
  ✅ test_canvas_fingerprinting
test.test_crawl
  ✅ test_browser_profile_coverage
test.test_js_instrument_py
  ✅ test_merge_diff_instrumented_names
  ✅ test_merge_multiple_duped_properties
  ✅ test_merge_multiple_duped_properties_different_log_settings
  ✅ test_api_whole_module
  ✅ test_api_two_keys_in_shortcut
  ✅ test_api_instances_on_window
  ✅ test_api_instances_on_window_with_properties
  ✅ test_api_module_specific_properties
  ✅ test_api_passing_partial_log_settings

Annotations

Check failure on line 0 in junit-report.xml

See this annotation in the file changed.

@github-actions github-actions / 4

pytest ► test.test_http_instrumentation ► test_cache_hits_recorded

Failed test found in:
  junit-report.xml
Error:
  http_params = <function http_params.<locals>.parameterize at 0x7f67b4ce9bc0>
Raw output
http_params = <function http_params.<locals>.parameterize at 0x7f67b4ce9bc0>
task_manager_creator = <function task_manager_creator.<locals>._create_task_manager at 0x7f67b4ce9d00>

    def test_cache_hits_recorded(http_params, task_manager_creator):
        """Verify all http responses are recorded, including cached responses
    
        Note that we expect to see all of the same requests and responses
        during the second vist (even if cached) except for images. Cached
        images do not trigger Observer Notification events.
        See Bug 634073: https://bugzilla.mozilla.org/show_bug.cgi?id=634073
    
        The test page includes an image which does several permanent redirects
        before returning a 404. We expect to see new requests and responses
        for this image when the page is reloaded. Additionally, the redirects
        should be cached.
        """
        test_url = utilities.BASE_TEST_URL + "/http_test_page.html"
        manager_params, browser_params = http_params()
        # ensuring that we only spawn one browser
        manager_params.num_browsers = 1
        manager, db = task_manager_creator((manager_params, [browser_params[0]]))
        for i in range(2):
            cs = CommandSequence(test_url, site_rank=i)
            cs.get(sleep=5)
            manager.execute_command_sequence(cs)
    
        manager.close()
    
        request_id_to_url = dict()
    
        # HTTP Requests
        rows = db_utils.query_db(
            db,
            """
            SELECT hr.*
            FROM http_requests as hr
            JOIN site_visits sv ON sv.visit_id = hr.visit_id and sv.browser_id = hr.browser_id
            WHERE sv.site_rank = 1""",
        )
        observed_records = set()
        for row in rows:
            # HACK: favicon caching is unpredictable, don't bother checking it
            if row["url"].split("?")[0].endswith("favicon.ico"):
                continue
            observed_records.add(
                (
                    row["url"].split("?")[0],
                    row["top_level_url"],
                    row["triggering_origin"],
                    row["loading_origin"],
                    row["loading_href"],
                    row["is_XHR"],
                    row["is_third_party_channel"],
                    row["is_third_party_to_top_window"],
                    row["resource_type"],
                )
            )
            request_id_to_url[row["request_id"]] = row["url"]
>       assert observed_records == HTTP_CACHED_REQUESTS
E       AssertionError: assert {('http://loc... 0, ...), ...} == {('http://loc... 0, ...), ...}
E         
E         Extra items in the left set:
E         ('http://localhost:8000/test_pages/shared/test_image.png', 'http://localhost:8000/test_pages/http_test_page.html', 'http://localhost:8000', 'http://localhost:8000', 'http://localhost:8000/test_pages/http_test_page_2.html', 0, ...)
E         ('http://localhost:8000/test_pages/shared/test_style.css', 'http://localhost:8000/test_pages/http_test_page.html', 'http://localhost:8000', 'http://localhost:8000', 'http://localhost:8000/test_pages/http_test_page.html', 0, ...)
E         ('http://localhost:8000/test_pages/shared/test_image_2.png', 'http://localhost:8000/test_pages/http_test_page.html', 'http://localhost:8000', 'http://localhost:8000', 'http://localhost:8000/test_pages/http_test_page_2.html', 0, ...)
E         ('http://localhost:8000/test_pages/shared/test_image.png', 'http://localhost:8000/test_pages/http_test_page.html', 'http://localhost:8000', 'http://localhost:8000', 'http://localhost:8000/test_pages/http_test_page.html', 0, ...)
E         
E         Full diff:
E           {
E               (
E                   'http://localhost:8000/404.png',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page_2.html',
E                   0,
E                   None,
E                   None,
E                   'image',
E               ),
E               (
E                   'http://localhost:8000/MAGIC_REDIRECT/frame1.png',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page_2.html',
E                   0,
E                   None,
E                   None,
E                   'image',
E               ),
E               (
E                   'http://localhost:8000/MAGIC_REDIRECT/frame2.png',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page_2.html',
E                   0,
E                   None,
E                   None,
E                   'image',
E               ),
E               (
E                   'http://localhost:8000/MAGIC_REDIRECT/req1.png',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   0,
E                   None,
E                   None,
E                   'image',
E               ),
E               (
E                   'http://localhost:8000/MAGIC_REDIRECT/req2.png',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   0,
E                   None,
E                   None,
E                   'image',
E               ),
E               (
E                   'http://localhost:8000/MAGIC_REDIRECT/req3.png',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   0,
E                   None,
E                   None,
E                   'image',
E               ),
E               (
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'undefined',
E                   'undefined',
E                   'undefined',
E                   0,
E                   None,
E                   None,
E                   'main_frame',
E               ),
E               (
E                   'http://localhost:8000/test_pages/http_test_page_2.html',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   0,
E                   None,
E                   None,
E                   'sub_frame',
E               ),
E               (
E         +         'http://localhost:8000/test_pages/shared/test_image.png',
E         +         'http://localhost:8000/test_pages/http_test_page.html',
E         +         'http://localhost:8000',
E         +         'http://localhost:8000',
E         +         'http://localhost:8000/test_pages/http_test_page.html',
E         +         0,
E         +         None,
E         +         None,
E         +         'image',
E         +     ),
E         +     (
E         +         'http://localhost:8000/test_pages/shared/test_image.png',
E         +         'http://localhost:8000/test_pages/http_test_page.html',
E         +         'http://localhost:8000',
E         +         'http://localhost:8000',
E         +         'http://localhost:8000/test_pages/http_test_page_2.html',
E         +         0,
E         +         None,
E         +         None,
E         +         'image',
E         +     ),
E         +     (
E                   'http://localhost:8000/test_pages/shared/test_image_2.png',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E         +         0,
E         +         None,
E         +         None,
E         +         'image',
E         +     ),
E         +     (
E         +         'http://localhost:8000/test_pages/shared/test_image_2.png',
E         +         'http://localhost:8000/test_pages/http_test_page.html',
E         +         'http://localhost:8000',
E         +         'http://localhost:8000',
E         +         'http://localhost:8000/test_pages/http_test_page_2.html',
E                   0,
E                   None,
E                   None,
E                   'image',
E               ),
E               (
E                   'http://localhost:8000/test_pages/shared/test_script.js',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   0,
E                   None,
E                   None,
E                   'script',
E               ),
E               (
E                   'http://localhost:8000/test_pages/shared/test_script_2.js',
E                   'http://localhost:8000/test_pages/http_test_page.html',
E                   'http://localhost:8000',
E                   'http://localhost:8000',
E                   'http://localhost:8000/test_pages/http_test_page_2.html',
E                   0,
E                   None,
E                   None,
E                   'script',
E               ),
E         +     (
E         +         'http://localhost:8000/test_pages/shared/test_style.css',
E         +         'http://localhost:8000/test_pages/http_test_page.html',
E         +         'http://localhost:8000',
E         +         'http://localhost:8000',
E         +         'http://localhost:8000/test_pages/http_test_page.html',
E         +         0,
E         +         None,
E         +         None,
E         +         'stylesheet',
E         +     ),
E           }

/home/runner/work/OpenWPM/OpenWPM/test/test_http_instrumentation.py:1055: AssertionError