Azure / Azure/azure-sdk-for-cpp

WS8: Tests, documentation, and release engineering for GA

Open
#7,260 0 comments 0 reactions 1 assignee Claimed by @j7nw4r View on GitHub
Event Hubs
Dominant language
C++
Stars
205
Forks
172
Avg merge
1d 3h
Merged PRs (30d)
37

Description

## Summary

No offline test exercises link recovery, token refresh, or retry classification, because no transport fake exists. CI accepts 27 percent line coverage and 13 percent branch coverage. The README teaches an API that the package removed. The samples cover no processor scenario, although the processor is the flagship consume pattern. Neither package ships a `TROUBLESHOOTING.md`.

The test items gate the other workstreams: the reliability fixes in #7254, #7255, #7256, and #7257 are unverifiable without them. Severity tags follow the key in #7252.

## Motivation

The .NET library backs its reliability behavior with thousands of offline unit tests that use AMQP fakes, for example `sdk/eventhub/Azure.Messaging.EventHubs.Shared/tests/RetryPolicies/BasicRetryPolicyTests.cs` and `tests/Processor/PartitionLoadBalancerTests.cs`. It also ships live tests and a stress suite.

The C++ package has about 59 test cases across 11 files, and the client tests gate on live environment variables through the test base (`test/ut/eventhubs_test_base.hpp:26-101`). No offline test covers link recovery, token refresh, or retry classification, because no transport fake exists. CI accepts 27 percent line coverage and 13 percent branch coverage (`sdk/eventhubs/ci.yml:32-33`). A stress test exists for batch send scenarios and a perf test exists, but there is no processor long-haul test.

The documentation describes an API that no longer exists. The README teaches connection string authentication in the client construction section (`README.md:134-142`), the send example (`README.md:175-193`), and the receive example (`README.md:205-210`). Those examples also use `EventDataBatch` direct construction, `AddMessage`, and `SendEventDataBatch`, none of which exist on the current surface. Samples cover `basic-operations`, `produce-events`, and `consume-events` only, with no processor or checkpoint sample. Neither Event Hubs package ships a `TROUBLESHOOTING.md`, while .NET ships one at `sdk/eventhub/Azure.Messaging.EventHubs/TROUBLESHOOTING.md`.

Issue #7250 restores the connection string constructors. Coordinate the README rewrite with that work, so the examples match the surface that actually ships.

## Proposal

- [ ] Add offline unit tests, backed by a transport fake, for every behavior that #7254, #7255, #7256, and #7257 introduce: link rebuild, token refresh, transient-only retry, cancellable backoff, close idempotency, the processor error callback, checkpoint parsing, and the batch envelope annotation. **[GA blocker]**
- [ ] Rewrite the README so every code sample compiles against the shipped surface (`README.md:134-142,175-193,205-210`). **[GA blocker]**
- [ ] Add a processor sample with the blob checkpoint store. **[GA blocker]**
- [ ] Make the live tests run green in CI across the full platform matrix, and make the vcpkg ports of both Event Hubs packages and the chosen transport build across that matrix (`sdk/eventhubs/ci.yml:26-60`). **[GA blocker]**
- [ ] Raise the CI coverage targets from 27 percent line and 13 percent branch to targets the team sets for GA (`sdk/eventhubs/ci.yml:32-33`). **[GA quality bar]**
- [ ] Add a processor long-haul stress scenario next to the existing batch send scenarios (`test/eventhubs-stress-test/src/scenarios/src/batch_stress_tests.cpp`). **[GA quality bar]**
- [ ] Add `TROUBLESHOOTING.md` for both packages, modeled on the .NET one. **[GA quality bar]**
- [ ] Document the at-least-once delivery contract in `TROUBLESHOOTING.md` and in the README. Event Hubs does not support AMQP link recovery, so a reconnect can deliver an event two times, and a caller must expect a duplicate. Microsoft states the contract directly: "Service Bus and Event Hubs support 'at least once' transfer where the sender can be assured for the message having been stored and accepted, but don't support 'exactly once' transfers at the AMQP level" ([AMQP 1.0 in Service Bus and Event Hubs protocol guide](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-protocol-guide)). The link rebuild work in #7254 makes this contract visible to a caller, so the documentation must state it. **[GA quality bar]**

## Validation

- [ ] Every reliability behavior from #7254 through #7257 has an offline test that fails before its fix and passes after.
- [ ] Every README code sample compiles.
- [ ] CI is green on the full platform matrix, including the live tests and the vcpkg port builds.
- [ ] A processor and a producer each run 24 hours against a live hub with induced link detaches and survive without a restart.

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.