Skip to content

SNOW-2912540: rewrite telemetry tests to verify the actual wire payload - #4323

Draft
sfc-gh-fpawlowski wants to merge 6 commits into
SNOW-2912540-mitmproxy-capture-fixturefrom
SNOW-2912540-mitmproxy-telemetry-tests
Draft

SNOW-2912540: rewrite telemetry tests to verify the actual wire payload#4323
sfc-gh-fpawlowski wants to merge 6 commits into
SNOW-2912540-mitmproxy-capture-fixturefrom
SNOW-2912540-mitmproxy-telemetry-tests

Conversation

@sfc-gh-fpawlowski

Copy link
Copy Markdown
  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-NNNNNNN

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
    • If adding any arguments to public Snowpark APIs or creating new public Snowpark APIs, I acknowledge that I have ensured my changes include AST support. Follow the link for more information: AST Support Guidelines
  3. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

sfc-gh-fpawlowski commented Aug 20, 2026

Copy link
Copy Markdown
Author

@sfc-gh-fpawlowski
sfc-gh-fpawlowski force-pushed the SNOW-2912540-mitmproxy-capture-fixture branch from 3d8fa0d to e0d3906 Compare August 20, 2026 17:14
@sfc-gh-fpawlowski
sfc-gh-fpawlowski force-pushed the SNOW-2912540-mitmproxy-telemetry-tests branch 3 times, most recently from 8ccaf7b to 246d926 Compare August 21, 2026 06:53
@codecov-commenter

codecov-commenter commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.26%. Comparing base (e9e3c23) to head (1f5a5ff).

Additional details and impacted files
@@                           Coverage Diff                           @@
##           SNOW-2912540-mitmproxy-capture-fixture    #4323   +/-   ##
=======================================================================
  Coverage                                   89.26%   89.26%           
=======================================================================
  Files                                         171      171           
  Lines                                       44709    44709           
  Branches                                     7688     7688           
=======================================================================
  Hits                                        39909    39909           
  Misses                                       3660     3660           
  Partials                                     1140     1140           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sfc-gh-fpawlowski
sfc-gh-fpawlowski force-pushed the SNOW-2912540-mitmproxy-capture-fixture branch from d7af463 to 9084ff3 Compare August 21, 2026 08:35
@sfc-gh-fpawlowski
sfc-gh-fpawlowski force-pushed the SNOW-2912540-mitmproxy-telemetry-tests branch 4 times, most recently from 7cf1721 to 3346408 Compare August 21, 2026 09:45
@sfc-gh-fpawlowski
sfc-gh-fpawlowski force-pushed the SNOW-2912540-mitmproxy-capture-fixture branch 2 times, most recently from a45ae31 to 8f91d4a Compare August 21, 2026 09:59
@sfc-gh-fpawlowski
sfc-gh-fpawlowski force-pushed the SNOW-2912540-mitmproxy-telemetry-tests branch 4 times, most recently from 6451408 to 3f1ca0e Compare August 21, 2026 13:14
@sfc-gh-fpawlowski
sfc-gh-fpawlowski force-pushed the SNOW-2912540-mitmproxy-telemetry-tests branch from 3f1ca0e to fc2d729 Compare August 21, 2026 13:35
Migrates the 10 single-check TelemetryDataTracker call sites in
tests/integ/test_telemetry.py to a new WireTelemetryChecker that verifies
telemetry against the real /telemetry/send payload captured by the mitmproxy
fixture, instead of the connector's in-process _log_batch buffer (removed on
the Universal Driver, drivers#1104/BD#58).

Session.close() is the only lever that reliably forces an immediate flush on
both drivers (send_log_batch/send_batch are no-ops on the Universal Driver,
where flush is core-owned) -- confirmed against the Rust core source: close()
blocks synchronously on the flush via an in-process PyO3 call, no subprocess
or async race involved. WireTelemetryChecker closes its session as part of
each check, so it needs a dedicated session rather than the shared
module-scoped one; extracted _build_session() out of the `session` fixture in
conftest.py so both it and the (now fully-configured) `mitmproxy_session`
fixture share the same setup/teardown logic. Also fixes a copy-paste bug from
the mitmproxy_session fixture's initial commit: its finally block referenced
an undefined `session` variable and called an unrelated cleanup helper meant
for a different fixture.

test_udf_call_and_invoke, test_sproc_call_and_invoke, and test_udtf_call_and_invoke
stay on the mock-patch-based TelemetryDataTracker (from the prior commit) --
each calls the tracker multiple times against one session, which is
incompatible with close-to-flush. tests/integ/modin/test_telemetry.py's one
remaining case also stays on the mock-patch fix, for the same reason.
@cursor
cursor Bot force-pushed the SNOW-2912540-mitmproxy-capture-fixture branch from 7a6d3eb to 4c2c0cc Compare September 2, 2026 06:45
@cursor
cursor Bot force-pushed the SNOW-2912540-mitmproxy-telemetry-tests branch from fc2d729 to bdedeaf Compare September 2, 2026 06:45
cursoragent and others added 5 commits September 2, 2026 17:39
…-mitmproxy-telemetry-tests

Co-authored-by: Filip Pawłowski <sfc-gh-fpawlowski@users.noreply.github.com>
…-mitmproxy-telemetry-tests

Co-authored-by: Filip Pawłowski <sfc-gh-fpawlowski@users.noreply.github.com>
…-mitmproxy-telemetry-tests

Co-authored-by: Filip Pawłowski <sfc-gh-fpawlowski@users.noreply.github.com>
…-mitmproxy-telemetry-tests

Co-authored-by: Filip Pawłowski <sfc-gh-fpawlowski@users.noreply.github.com>
…-mitmproxy-telemetry-tests

Co-authored-by: Filip Pawłowski <sfc-gh-fpawlowski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants