test(eventhubs): cover blob checkpoint store isolation - #5090
Draft
Johnathan W (j7nw4r) wants to merge 1 commit into
Draft
test(eventhubs): cover blob checkpoint store isolation#5090Johnathan W (j7nw4r) wants to merge 1 commit into
Johnathan W (j7nw4r) wants to merge 1 commit into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 3 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Add a test file for the blob checkpoint store. Six live tests write two records that differ in one key part only, then list one key and make sure the other record does not appear. Four live tests point the store at a container that does not exist and make sure each operation reports HTTP 404 with the ContainerNotFound error code. The service tests are live only. A new recorded test name has no asset in the pinned assets tag, so a playback run would fail on a missing recording. Seven key-builder tests run with no service and no environment variable. A mutation proof backs them. Seven single-line edits to the checkpoint and ownership key builders each make the predicted test fail.
Johnathan W (j7nw4r)
force-pushed
the
j7nw4r/eventhubs-blob-checkpoint-live-tests
branch
from
August 25, 2026 18:13
46aebc7 to
d677ea8
Compare
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
azure_messaging_eventhubs_checkpointstore_blobhad 14 tests, which covered claims, etag versions, and a stale etag failure. This change adds 17 tests. They cover record isolation across the event hub, the consumer group, and the namespace, and the error that store operations return against a container that does not exist.Motivation
The blob checkpoint store keys every record by namespace, event hub, consumer group, and partition. A wrong key lets two unrelated processors overwrite each other's checkpoints, and events are then lost or processed twice. No test pinned that key. The four key builders in
event_processor/models.rshad no unit test at all, and no test covered a container that does not exist.Two of the existing tests look like isolation proofs but cannot fail.
list_checkpointsandlist_ownershipscopy the namespace, the event hub, and the consumer group from the caller's own arguments onto every returned record, so an assertion on those three fields proves nothing. The new tests do not use that shape.Changes
tests/checkpoint_store_isolation_tests.rswith 17 tests and no change to any other file.list_checkpoints,list_ownerships,update_checkpoint, andclaim_ownershipgive HTTP 404 with theContainerNotFounderror code against a container that does not exist.#[test]unit tests over the four public key builders, which pin the blob name layout with no service.partition_id, and by blob metadata, never by the three fields that the list methods copy from their arguments.mod checkpoint_unit_tests;, which would compile and run the 7 existing checkpoint tests a third time.Test plan
#[recorded::test(live)], not#[recorded::test]. A new recorded test name has no recording in the tag thatassets.jsonpins, so CI fails it withheader not found x-recording-id. A live test is compiled with#[ignore]unlessAZURE_TEST_MODE=live, so it needs no recording asset.assets.jsonis unchanged, and no recording must be pushed for this change.CARGO_BUILD_JOBS=1 cargo test -p azure_messaging_eventhubs_checkpointstore_blob --test checkpoint_store_isolation_tests -- --test-threads=1gives 7 passed, 0 failed, 10 ignored.sdk/eventhubs/azure_messaging_eventhubs/src/event_processor/models.rseach broke the predicted tests and were then reverted. A change of/checkpoint/to/checkpoints/at line 58 breaks the two checkpoint layout tests. A dropped+ partition_idat line 73 breakscheckpoint_blob_name_appends_partition_idalone. A dropped consumer group at lines 56 and 57 breakscheckpoint_blob_name_differs_for_each_key_part. A droppedcheck_non_empty_parameter!(consumer_group);at line 52 breakskey_builders_reject_empty_key_partsalone. The ownership builders give the same result at lines 116, 134, 112, and 113.cargo fmt --check,cargo clippy --all-features --all-targetswith-Dwarnings,cargo doc --all-features --no-depswith-Dwarnings, and cspell with the repository configuration all pass.Three findings from this work are out of scope here and need their own issues.
set_checkpoint_metadata_on_blobtreats every 404 fromset_metadataas a missing blob and retries with an upload. For a missing container it logs "Blob ... not found, creating." and then fails on the upload. The returned error is correct, and the log names the wrong cause.checkpoint_unit_tests.rs:65-66andownership_unit_tests.rs:52-53and their peers stay vacuous, because this change adds a file and edits none.Closes #4894.
Live validation
Every test here ran against a live Event Hubs namespace on 2026-08-20: 17 passed, 0 failed.
Command:
AZURE_TEST_MODE=live cargo test --package azure_messaging_eventhubs_checkpointstore_blob -- --test-threads=1.No change was needed. The tests passed as written on the first live run.