chore: stabilize sdk compliance adapter#617
Open
marandaneto wants to merge 1 commit into
Open
Conversation
Contributor
|
Reviews (1): Last reviewed commit: "chore: stabilize sdk compliance adapter" | Re-trigger Greptile |
Contributor
posthog-python Compliance ReportDate: 2026-05-22 08:53:35 UTC
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 516ms |
| Format Validation.Event Has Uuid | ✅ | 1507ms |
| Format Validation.Event Has Lib Properties | ✅ | 1506ms |
| Format Validation.Distinct Id Is String | ✅ | 1506ms |
| Format Validation.Token Is Present | ✅ | 1506ms |
| Format Validation.Custom Properties Preserved | ✅ | 1506ms |
| Format Validation.Event Has Timestamp | ✅ | 1506ms |
| Retry Behavior.Retries On 503 | ✅ | 9518ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 3505ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 3506ms |
| Retry Behavior.Respects Retry After Header | ✅ | 9509ms |
| Retry Behavior.Implements Backoff | ✅ | 23526ms |
| Retry Behavior.Retries On 500 | ✅ | 7515ms |
| Retry Behavior.Retries On 502 | ✅ | 7509ms |
| Retry Behavior.Retries On 504 | ✅ | 7508ms |
| Retry Behavior.Max Retries Respected | ✅ | 23532ms |
| Deduplication.Generates Unique Uuids | ✅ | 1495ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 7515ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 14519ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 7506ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 1503ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 1506ms |
| Compression.Sends Gzip When Enabled | ✅ | 1506ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 1506ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 1004ms |
| Batch Format.Multiple Events Batched Together | ✅ | 1506ms |
| Error Handling.Does Not Retry On 403 | ✅ | 3508ms |
| Error Handling.Does Not Retry On 413 | ✅ | 3507ms |
| Error Handling.Retries On 408 | ✅ | 7513ms |
Feature_Flags Tests
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ❌ | 1002ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 1006ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ✅ | 1006ms |
| Request Payload.Flags Request Omits Authorization Header | ✅ | 1006ms |
| Request Payload.Token In Flags Body Matches Init | ❌ | 1005ms |
| Request Payload.Groups Round Trip | ✅ | 1006ms |
| Request Payload.Groups Default To Empty Object | ✅ | 1006ms |
| Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It | ✅ | 1006ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ✅ | 1006ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ✅ | 1006ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 1006ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 503ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 1506ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 1009ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 1003ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 1508ms |
Failures
request_payload.request_with_person_properties_device_id
Field 'token' not found in /flags request body at path 'token'. Available keys: ['distinct_id', 'groups', 'person_properties', 'group_properties', 'geoip_disable', 'device_id', 'flag_keys_to_evaluate', 'sentAt', 'api_key']
request_payload.token_in_flags_body_matches_init
Field 'token' not found in /flags request body at path 'token'. Available keys: ['distinct_id', 'groups', 'person_properties', 'group_properties', 'geoip_disable', 'device_id', 'flag_keys_to_evaluate', 'sentAt', 'api_key']
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Fix the SDK compliance adapter state handling for the Feature_Flags compliance suite.
The adapter could deadlock during test reset because it held
SDKState.lockwhileclient.shutdown()flushed pending events through the patched transport, which also records requests under the same lock. Feature flag side-effect events could also be flushed after an adapter action returned, leaking into the next compliance test's mock-server state.💚 How did you test it?
uv run --with flask --with python-dateutil python sdk_compliance_adapter/adapter.py/Users/marandaneto/Github/posthog-sdk-test-harnesswith PR Client exit when /batch response return none 200 status code. #19 changes:uv run posthog-test-harness run --adapter-url http://localhost:18080 --suite feature_flags --output text --concurrency 1📝 Checklist
If releasing new changes
sampo addto generate a changeset file