Azure / Azure/azure-sdk-for-rust
[Event Hubs] Add live tests for the event processor
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 109
Description
## Summary
The processor live tests cover one processing run and one Greedy displacement path, both against `InMemoryCheckpointStore`. No test restarts a processor and asserts that it resumes after the checkpoint. No test calls `shutdown()`; the tests abort the task instead. No test asserts ownership records, the balanced strategy, invalid configuration errors, or a run against `BlobCheckpointStore`.
## Motivation
Checkpoint resume is the core promise of the processor. If a processor restarts and reprocesses from the start, or skips events, the checkpoint contract is broken and no current test detects it. Load balancing and graceful shutdown are the other two behaviors that a caller depends on in production. Part of #4886.
## Proposal
- [ ] Checkpoint resume across instances. Process events, checkpoint, shut down, start a new processor with the same store, and make sure that processing resumes after the checkpoint (.NET `ProcessorClientBeginsWithTheNextEventAfterCheckpointing`).
- [ ] Graceful `shutdown()` and restart of the same processor configuration (.NET `ProcessorClientCanRestartAfterStopping`, `ProcessorClientCeasesProcessingWhenStopping`).
- [ ] Ownership records appear in the checkpoint store after the processor claims partitions (.NET `ProcessorClientCreatesOwnership`).
- [ ] Two processors with the balanced strategy split the partitions, and both processors receive events (.NET `EventsCanBeReadByMultipleProcessorClients`). The Greedy displacement path is already covered in `second_processor_displaces_first_with_consumer_disconnected`.
- [ ] Invalid configuration surfaces a clear error for a bad namespace, a bad event hub name, a bad consumer group, and a bad storage container (.NET `ProcessorClientDetectsAnInvalid*` family).
- [ ] Run the processor end to end on `BlobCheckpointStore` against live Event Hubs and live Storage.
The .NET tests detect invalid configuration at start time. The Rust processor can surface the same conditions at open time or at claim time instead. Assert the behavior, not the exact .NET timing.
## Validation
Deploy the test resources with `eng/common/TestResources/New-TestResources.ps1 -ServiceDirectory eventhubs`. Set `EVENTHUBS_HOST`, `EVENTHUB_NAME`, and the storage variables. Then run `AZURE_TEST_MODE=live cargo test --package azure_messaging_eventhubs --test '*'`. Each new test passes in live mode.
Contributor guide
Assessment
This issue has not been assessed yet.