Repository navigation
Route $sample statistics and the modify smoke test through assertions - #738
Merged
Merged
Conversation
Signed-off-by: Samar Farooqi <samafarc@amazon.com>
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (53+23 LOC, 2 files) If a label is wrong, ping |
eerxuan
approved these changes
Nov 24, 2026
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
Three tests fail on some engines in a way the assertion helpers never see, so a
run cannot judge them. This PR routes each one through an assertion helper.
Nothing changes for an engine that passes them today.
test_sample_statistical_randomnessandtest_sample_statistical_uniformityran the
$sampleloop and then raised their ownAssertionError. They nowcompute the same statistic and check it with
assertSuccess:{"unreached": []}(documents never returned within 1500 runs) and{"underfilled": []}(documents returned fewer than 50 times out of 3000).The thresholds are unchanged. An error from any run is passed to
assertSuccessas is, which reports it as before.test_smoke_changeStream_modifychanged the validator to{"x": {"$type": "int"}}. An engine that only supports$jsonSchemavalidators rejects that
collMod, so the smoke test reported the validator,not the modify event. It now uses
{"$jsonSchema": {"required": ["x"]}}.Like the other change stream smoke tests after Make smoke tests capability probes; fix 5 that crash on engine divergence (PR#718 Rebased) #731 and Route remaining test-side failures through the assertion #736, it reads with
execute_command_untiland checks the batch withassertChangeStreamEvent.The
$matchstage still selects onlymodifyevents.Testing
$sampletests now fail throughassertSuccess(
{'unreached': [1, 2, 3, 4]},{'underfilled': [1, 2, 3, 4]}) instead of abare
AssertionError. ThecollModwith the$jsonSchemavalidatorsucceeds.
pytest documentdb_tests/framework: 86 passed.