testbed: refactor TestCase with broken out LoadGenerator interface #30303
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Adding a feature - These changes break out the current
testbed.LoadGenerator
to an interface of the same name, migrating its (reference) implementation to a newtestbed.ProviderSender
type. This will allow future test cases (in arbitrary distributions) to use the existing*TestCase
flow, but with arbitrary load generator implementations beyond the capabilities of the current one. They also provide a newtestbed.NewLoadGeneratorTestCase
similar to the existingtestbed.NewTestCase
that is now called indirectly. I chose this route to not force further signature changes.In the process of this work, I found a few edge cases that can lead to* races and hanging processes in error scenarios. They've been addressed w/ some minimal synchronization.
Here's a partial* example of a LoadGenerator that can manage an arbitrary number of
ProviderSender
instances, each of varying telemetry types, that can now be used:Documentation:
Updated readme.