-
Notifications
You must be signed in to change notification settings - Fork 30
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
Implement TestContainers Unit Tests with CaptureProxy #508
Implement TestContainers Unit Tests with CaptureProxy #508
Conversation
…onfigurationProxyTest Signed-off-by: Andre Kurait <[email protected]>
a9d5d4e
to
ba29790
Compare
Signed-off-by: Andre Kurait <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #508 +/- ##
============================================
+ Coverage 75.48% 76.45% +0.96%
- Complexity 1360 1375 +15
============================================
Files 158 158
Lines 6085 6085
Branches 530 530
============================================
+ Hits 4593 4652 +59
+ Misses 1139 1075 -64
- Partials 353 358 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
...ture/testUtilities/src/testFixtures/java/org/opensearch/migrations/testutils/PortFinder.java
Show resolved
Hide resolved
...er/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/ContainerTestBase.java
Outdated
Show resolved
Hide resolved
// Calculate average duration of impaired calls | ||
var averageImpairedDuration = assertBasicCalls(captureProxy, numberOfTests); | ||
|
||
long acceptableDifference = Duration.ofMillis(25).toMillis(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think that this a risk to become a flaky test? How can we make it relatively stable (> 99-99.9%)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The observed latency is 5-10ms on all the runs I've done, that's where 25 was set to have the buffer.
Even when the machine is overloaded by concurrent tests, this is measuring the difference with vs without the proxy so it has some resiliency there. We could move it to a % of the total time if that seems more robust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we see it flaky, we can add a resource lock on it to execute in isolation
…onents Signed-off-by: Andre Kurait <[email protected]>
Signed-off-by: Andre Kurait <[email protected]>
Description
Adds CaptureProxy test container tests with a framework to test and simulate a variety of failure modes. In this version, adding the base functionality to spin up docker containers for Kafka as well as a Destination container which are reused between tests, as well as a ToxiProxy container to be used on each test as a proxy between the CaptureProxy and Kafka to enable simulation of failure modes (network disconnect, latency, etc.).
This PR includes a set of tests which simulate Kafka failure modes occurring prior to the start of the CaptureProxy. These tests are currently failing and marked as Disabled due to a bug in the CaptureProxy and will be enabled with the bug fix in MIGRATIONS-1489
Also, updates test containers version to 1.19.5 to address a mend security issue.
Issues Resolved
MIGRATIONS-1503
Is this a backport? If so, please add backport PR # and/or commits #
No
Testing
Unit Testing
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.