Skip to content

Commit 66492e5

Browse files
authored
test(gen-metrics): Use 4 bytes for set values instead of 8 (#69638)
Relay sends u32 for set values, local tests should reflect this. Ran ``` pytest -k 'not __In' tests/snuba \ tests/sentry/eventstream/kafka \ tests/sentry/post_process_forwarder \ tests/sentry/snuba \ tests/sentry/eventstore/snuba \ tests/sentry/search/events \ tests/sentry/event_manager \ tests/sentry/api/endpoints/test_organization_profiling_functions.py \ tests/snuba/api/endpoints/test_organization_events_stats_mep.py \ tests/sentry/sentry_metrics/querying \ tests/snuba/test_snql_snuba.py \ tests/snuba/test_metrics_layer.py ``` 3 tests failed with postgres error, none of which seems to have anything to do with metrics, going to assume it's the local environment. Errors: ``` ERROR tests/sentry/event_manager/grouping/test_assign_to_group.py::test_existing_group_no_new_hash[ new_logic_enabled: False - in_transition: True ] - django.db.utils.IntegrityError: ForeignKeyViolation('insert or update on table "sentry_environmentpro... ERROR tests/sentry/event_manager/grouping/test_assign_to_group.py::test_existing_group_new_hash_exists[ secondary_hash_exists: True - new_logic_enabled: False - in_transition: True ] - django.db.utils.IntegrityError: ForeignKeyViolation('insert or update on table "sentry_environmentpro... ERROR tests/sentry/event_manager/grouping/test_assign_to_group.py::test_existing_group_new_hash_exists[ secondary_hash_exists: False - new_logic_enabled: True - in_transition: True ] - django.db.utils.IntegrityError: ForeignKeyViolation('insert or update on table "sentry_environmentpro... E django.db.utils.IntegrityError: ForeignKeyViolation('insert or update on table "sentry_environmentproject" violates foreign key constraint "sentry_environmentpr_environment_id_f5d02227_fk_sentry_en"\nDETAIL: Key (environment_id)=(7) is not present in table "sentry_environment".\n') E SQL: SET CONSTRAINTS ALL IMMEDIATE ```
1 parent 1aa373a commit 66492e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sentry/testutils/cases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ def tag_value(name):
17101710

17111711
if type == "set":
17121712
# Relay uses a different hashing algorithm, but that's ok
1713-
value = [int.from_bytes(hashlib.md5(str(value).encode()).digest()[:8], "big")]
1713+
value = [int.from_bytes(hashlib.md5(str(value).encode()).digest()[:4], "big")]
17141714
elif type == "distribution":
17151715
value = [value]
17161716
elif type == "gauge":

0 commit comments

Comments
 (0)