-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test helper to verify exporter behavior on errors #7479
Comments
Hey! I spent some time figuring out this task (mostly in comparision with the receiver test helper) and have a few questions:
CC: @VihasMakwana |
Yes. I think the test helper itself can generate the necessary data and give to to exporter.
Yes, it would be useful to reuse it. You may need to add ability to return specific gRPC errors so that you can trigger the permanent and non-permanent error scenarios.
No. mockReceiver should be an implementation of the actual network protocol that the exporter-under-test uses. In case of otlpexpoter testing mockReceiver should OTLP/gRPC protocol receiving (or OTLP/HTTP for testing of otlphttpexporter). This is completely different from mockConsumer, which merely implements the internal Consumer interface.
I don't think it is necessary. The exporter test helper can generate the data itself. The generator does not need to be specific to the exporter. |
Hey @tigrannajaryan, I opened a Draft. So far only logs are implemented, but if you confirm it is good direction I'll add traces and metrics and open a proper PR. The behaviour of the exporter looks correct, this is the example of logs from a test suite I ran:
|
@omrozowicz-splunk Thanks for working on this. I probably won't be able to review your PR since I will out next week but Collector maintainers/approvers should be able to provide feedback. |
**Description:** Adding a test helper to test exporter behaviour on errors. **Link to tracking Issue:** #7479 Will also fix: #7481 It is created based on the exporter receiver test: #7516 The exporter targets `mockReceiver` as an endpoint. The test cases covered here are: 1. ConsumeLogs/Traces/Metrics call succeeds at the first try 2. ConsumeLogs/Traces/Metrics call fails once with non-permanent error, then succeeds on one of the next tries 3. ConsumeLogs/Traces/Metrics call fails once with permanent error and the data is not retried 4. ConsumeLogs/Traces/Metrics call fails once with permanent error or permanent error (then the test pass requirement is calculated based on number of errors per kind/successfully delivered data/total number of data to be delivered) --------- Co-authored-by: Dmitry Anoshin <anoshindx@gmail.com>
Resolved by #8143 |
The consumers (and all exporters are consumers) are required to follow the Error Handling contract which says:
and
We need a test helper that makes testing exporters for this part of the contract easy.
Helper Inputs
The helper should accept:
otlp
exporter testing we needotlp
receiver that behaves correctly according to OTLP protocol spec and responds as instructed by the helper.Events to Test for
It is important that all 3 event types happen during the test at least once:
The test helper should provide a data generator that can create data to be given to the exporter.
Test Scenarios
The helper should be possible to configure for testing for permanent errors scenario and must verify:
The helper should be possible to configure for testing for non-permanent errors scenario and must verify:
Other Requirements
The text was updated successfully, but these errors were encountered: