Skip to content
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

[chore]: Expand e2e testbed #27251

Merged
merged 22 commits into from
Oct 16, 2023
Merged

Conversation

VihasMakwana
Copy link
Contributor

@VihasMakwana VihasMakwana commented Sep 28, 2023

Related issue: #20552

Tweak the mock-backend to do following:

  • Receives data from the receiver.
  • Returns errors randomly to our receiver, which attempts to resend/drop the data.

This is helpful when we're required to test random behaviors of the collector and ensure reliable data delivery.

This is my initial PR to expand the testbed. This will help my further efforts to expand the testbed.
Myself and @omrozowicz-splunk plan on adding sending_queue support to the testbed and expanding the testing capabilities.

@VihasMakwana VihasMakwana marked this pull request as ready for review September 28, 2023 08:50
@VihasMakwana VihasMakwana requested review from a team, TylerHelmuth and djaglowski September 28, 2023 08:50
@VihasMakwana VihasMakwana changed the title [WIP] - Expand e2e testbed Expand e2e testbed Sep 28, 2023
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for implementing this as a connector rather than a processor?

@VihasMakwana
Copy link
Contributor Author

@djaglowski turns out we don't need to add a new mock component right now. I tweaked mockbackend to propagate the errors back to our data sender (with queue and retry disabled)

@djaglowski
Copy link
Member

Please address CI failures

@VihasMakwana
Copy link
Contributor Author

@djaglowski CI's green! Please review.
@TylerHelmuth I'd appreciate your review as well!

.chloggen/expand-e2e-testbed.yaml Outdated Show resolved Hide resolved
testbed/testbed/mock_backend.go Outdated Show resolved Hide resolved
@VihasMakwana VihasMakwana changed the title Expand e2e testbed [chore]: Expand e2e testbed Oct 4, 2023
@TylerHelmuth TylerHelmuth added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Oct 5, 2023
@VihasMakwana
Copy link
Contributor Author

@TylerHelmuth does the changes look good to you?

Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I am not very familiar with this testbed. I'd like someone else to approve as well

testbed/testbed/load_generator.go Outdated Show resolved Hide resolved
for {
if err := traceSender.ConsumeTraces(context.Background(), traceData); err != nil {
if consumererror.IsPermanent(err) {
if lg.prevErr == nil || lg.prevErr.Error() != err.Error() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining the meaning of the conditions on this line?

testbed/testbed/load_generator.go Outdated Show resolved Hide resolved
testbed/testbed/load_generator.go Outdated Show resolved Hide resolved
DroppedLogs []plog.Logs

// decision to return permanent/non-permanent errors
decision int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This notion of a "decision" is very generic. I also don't think a mandatory integer is an appropriate way to configure test cases. Finally, I think this kind of logic should not dominate the codebase of a simple and more widely used function.

To that end, I suggest the following:

  1. Use an options pattern to optionally pass this configuration to NewMockBackend.
  2. Instead of saving an int and switching on it. Just save the appropriate function here. (Default always returns nil.) Whether or not the error is permanent can be ascertained from the returned error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djaglowski I have updated to use function instead of integer and removed the mandatory integer.

testbed/testbed/mock_backend.go Outdated Show resolved Hide resolved
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
@VihasMakwana VihasMakwana force-pushed the poc-testbed branch 3 times, most recently from fa6385d to 51a8fa7 Compare October 11, 2023 17:16
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@VihasMakwana
Copy link
Contributor Author

@TylerHelmuth @djaglowski can we merge this one? I've rebased it to main and CI's green.

@djaglowski djaglowski merged commit 3c2935f into open-telemetry:main Oct 16, 2023
82 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 16, 2023
@VihasMakwana VihasMakwana deleted the poc-testbed branch October 16, 2023 17:34
JaredTan95 pushed a commit to openinsight-proj/opentelemetry-collector-contrib that referenced this pull request Oct 18, 2023
Related issue:
open-telemetry#20552

Tweak the mock-backend to do following:

- Receives data from the receiver.
- Returns errors randomly to our receiver, which attempts to resend/drop
the data.

This is helpful when we're required to test random behaviors of the
collector and ensure reliable data delivery.


This is my initial PR to expand the testbed. This will help my further
efforts to expand the testbed.
Myself and @omrozowicz-splunk plan on adding `sending_queue` support to
the testbed and expanding the testing capabilities.

---------

Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
jmsnll pushed a commit to jmsnll/opentelemetry-collector-contrib that referenced this pull request Nov 12, 2023
Related issue:
open-telemetry#20552

Tweak the mock-backend to do following:

- Receives data from the receiver.
- Returns errors randomly to our receiver, which attempts to resend/drop
the data.

This is helpful when we're required to test random behaviors of the
collector and ensure reliable data delivery.


This is my initial PR to expand the testbed. This will help my further
efforts to expand the testbed.
Myself and @omrozowicz-splunk plan on adding `sending_queue` support to
the testbed and expanding the testing capabilities.

---------

Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry testbed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants