Azure / Azure/azure-sdk-for-rust
[Event Hubs] Add live tests for consumer receive options
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 109
Description
## Summary
The consumer tests run with the default `prefetch` value. They set `receive_timeout` but do not assert its semantics. The `with_instance_id` builder option has no live coverage on either the consumer or the producer.
## Motivation
Prefetch controls the credit that the receiver grants to the link, so a wrong value can stall a stream or waste memory. The receive timeout controls what happens when a partition is idle. The instance id appears in service side diagnostics. .NET live-tests all three. Part of #4886.
## Proposal
- [ ] Read with a custom `prefetch` value, and read again with a very small `prefetch` value (.NET `ConsumerCanReadBatchOfEventsWithCustomPrefetchAndBatchCounts`, `ConsumerCanReadEventsWithPrefetchDisabled`).
- [ ] Assert the `receive_timeout` semantics. The stream must yield within the timeout when the partition is idle (.NET `ConsumerRespectsTheWaitTimeWhenReading`).
- [ ] Open clients with `with_instance_id` and make sure that operations succeed (.NET `ConsumerWithAnIdentifierCanReadEvents`, `ProducerWithIdentifierCanSend`).
## Validation
Deploy the test resources with `eng/common/TestResources/New-TestResources.ps1 -ServiceDirectory eventhubs`. Set `EVENTHUBS_HOST` and `EVENTHUB_NAME`. 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.