Azure / Azure/azure-sdk-for-rust

[Event Hubs] Add live tests for consumer start positions

Open
#4,887 0 comments 1 reaction 1 assignee Claimed by @j7nw4r View on GitHub
Client Event Hubs test-enhancement
Dominant language
Rust
Stars
884
Forks
365
Avg merge
2d 19h
Merged PRs (30d)
109

Description

## Summary

The consumer live tests use only two start positions. `eventhubs_consumer.rs` reads from `Earliest`, and `eventhubs_round_trip.rs` reads from a sequence number. `StartLocation` also supports Offset, `EnqueuedTime`, and `Latest`, and `StartPosition` has an `inclusive` flag. No live test covers those paths.

## Motivation

The start position controls where a receiver begins in a partition. The service resolves each position type differently, so a bug in one type does not show up in the tests for another type. .NET live-tests every position type on both the consumer client and the partition receiver. Part of #4886.

## Proposal

- [ ] Read from a specific offset (.NET `ConsumerCanReadFromOffset`, `ReceiverCanReadFromOffset`).
- [ ] Read from an enqueued time (.NET `ConsumerCanReadFromEnqueuedTime`).
- [ ] Read from `Latest` and receive only the events that are sent after the receiver opens (.NET `ConsumerCanReadFromLatest`).
- [ ] Exercise the `inclusive` flag on `StartPosition` for offset reads and for sequence number reads.

## 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.