test: drop flaky-prod xfails; harden premium limit + live-lane timeout - #130
Merged
Merged
Conversation
- remove all _FLAKY_PROD_DATA_XFAIL + 2 premium xfail markers; delete now-dead marker def/imports (conftest, test_call, test_integration) - fix stale test_symbols_with_market_only: request_endpoint validates mandatory exchange client-side -> expect ParameterRequiredError, not server ClientError - premium smoke test: limit=10 (unfiltered payload ReadTimeout at 10s) - live-lane client timeout 10s->30s via TIMEOUT (DATAMAXI_TIMEOUT env) full keyed suite: 252 passed; keyless CI lane unchanged.
This was referenced Jul 2, 2026
martinkersner
added a commit
that referenced
this pull request
Jul 2, 2026
Live-keyed lane went red on push to main: TestPremium.test_premium_target_market got HTTP 504 from prod (gateway timeout, not a client ReadTimeout — the 30s DATAMAXI_TIMEOUT from #130 can't help). The premium endpoint intermittently 504s under load; infra flakiness, not an SDK bug. - conftest: add live_call(fn) helper — retries transient 5xx (502/503/504) with linear backoff, pytest.skip on persistent transient; real 5xx/4xx and assertions propagate unchanged. - test_integration: route all TestPremium data calls through live_call. keyless CI lane: 134 passed, 11 skipped (unchanged). helper logic unit-verified.
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.
Summary
Makes the keyed live test suite green without xfail masking, and hardens the two setups that actually flaked.
_FLAKY_PROD_DATA_XFAILmarkers (2 intest_call.py, 8 intest_integration.py) and the 2 standalone premium@pytest.mark.xfail; deleted the now-dead marker definition + imports (conftest.py, both test files).test_symbols_with_market_onlyexpected server-sideClientError, but therequest_endpointrollout now validates the mandatoryexchangeparam client-side → raisesParameterRequiredError. Updated expectation + import. This was a real pre-existing failure, only surfaced by running integration with a key (keyless CI deselects it).premiumsmoke test now passeslimit=10— the unfilteredpremium()payload intermittentlyReadTimeouts at the 10s default.TIMEOUTinconftest.py(overridable withDATAMAXI_TIMEOUT). SDK default stays 10s (datamaxi/api.py:23) — this is test-lane only.Tests
DATAMAXI_API_KEY=… pytest): 252 passed, 0 skipped, 0 xfail.pytest -m "not integration"): unchanged — 134 passed, 11 skipped (no key), 107 deselected.Known failures / caveats
funding_rate.*andnaver.*can return500 "no data found". They pass now because the fleet is warm — a cold-start run could fail them again. Probed all previously-gated queries: currently all warm (non-empty, 0 errors).premium()raisesValueError('no data found')on an empty page instead of returning empty.limit=10reduces but does not eliminate the empty-window risk; a proper fix is normalizing empty-result handling in the SDK (follow-up).Non-local changes
None — changes are confined to the three test files (
tests/conftest.py,tests/test_call.py,tests/test_integration.py). No SDK/source changes.