Skip to content

fix(tests): Fix pre-prod eap integration tests#109852

Open
wedamija wants to merge 2 commits intomasterfrom
danf/fix-pre-prod-eap-ingestion-test
Open

fix(tests): Fix pre-prod eap integration tests#109852
wedamija wants to merge 2 commits intomasterfrom
danf/fix-pre-prod-eap-ingestion-test

Conversation

@wedamija
Copy link
Member

@wedamija wedamija commented Mar 4, 2026

These tests didn't inherit from the base testcase, and so were never running. I noticed this when using them as a base for similar tests for my project.

Once these tests ran in CI they ended up failing. The tests were producing TraceItems via the async Kafka producer, but SingletonProducer only flushes on process exit, so data never reached Snuba during test runs. Fix by intercepting the Kafka produce call to
capture the serialized TraceItem and inserting it via the synchronous HTTP endpoint (store_occurrences), which is the standard pattern used by all other Snuba integration tests.

Also add in missing __init__.py files.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Backend Test Failures

Failures on 9d2e501 in this run:

tests/snuba/preprod/eap/test_preprod_eap_integration.py::PreprodEAPIntegrationTest::test_write_and_read_size_metric_round_triplog
tests/snuba/preprod/eap/test_preprod_eap_integration.py:95: in test_write_and_read_size_metric_round_trip
    assert found, f"Data not found in Snuba after {max_attempts} attempts"
E   AssertionError: Data not found in Snuba after 20 attempts
E   assert False
tests/snuba/preprod/eap/test_preprod_eap_integration.py::PreprodEAPIntegrationTest::test_write_multiple_size_metrics_same_artifactlog
tests/snuba/preprod/eap/test_preprod_eap_integration.py:199: in test_write_multiple_size_metrics_same_artifact
    assert found_count == 2, f"Expected 2 records, found {found_count}"
E   AssertionError: Expected 2 records, found 0
E   assert 0 == 2

wedamija added 2 commits March 4, 2026 12:16
These tests didn't inherit from the base testcase, and so were never running. I noticed this when using them as a base for similar tests for my project.

Also add in missing `__init__.py` files.
…n tests

The tests were producing TraceItems via the async Kafka producer, but
SingletonProducer only flushes on process exit, so data never reached
Snuba during test runs. Fix by intercepting the Kafka produce call to
capture the serialized TraceItem and inserting it via the synchronous
HTTP endpoint (store_occurrences), which is the standard pattern used
by all other Snuba integration tests.
Copy link
Member

@trevor-e trevor-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty!

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.

2 participants