-
Notifications
You must be signed in to change notification settings - Fork 283
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
Speeding up tests #1715
Speeding up tests #1715
Conversation
Sleep statements should rarely be used, instead apis should allow for blocking/non-blocking calling patterns. Attempting to remove and clean up these statements to speed up PR workflows. Signed-off-by: Peter Nied <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1715 +/- ##
=========================================
Coverage 62.86% 62.87%
- Complexity 3262 3264 +2
=========================================
Files 253 253
Lines 18089 18096 +7
Branches 3243 3246 +3
=========================================
+ Hits 11372 11377 +5
- Misses 5063 5064 +1
- Partials 1654 1655 +1
Continue to review full report at Codecov.
|
The sleep was introduced by the removal of TransportClient PR. The intent is to make sure all configurations are loaded into security index, which used to be done as following. Sleep is not the best idea and doesn't really ensure that. Is there a better/faster way to ensure the existense of the configurations?
|
Long running CI is a huge pain of security plugin. This is a nice area to improve! Great contribution! 👍 |
First when I noticed and removed this sleep I had the same concern about stability. In the test setup OpenSearch nodes are created on a couple of threads, these communicate via http. From what I've seen when our tests cases are running, we are making calls via http which is out of process communication. When moving across the process boundary layer to the network the jvm stops processing work on the test thread and can resume work on any other busy node threads. This boundary layer means a busy cpu operation is very likely to complete on the nodes within that same process before the network connection of the test's inbound request is processed. This is not reliable protection on a production system; however, this seems to be working well with our JVM selections and our different environments. We might notice issues in the future - I imagine certain classes of tests might need additional checks, but we can deal with them as they present themselves.
In OpenSearch there is a task api that can be used to track work that is in progress or complete. If we needed additional assurance that the configuration was complete, I would advocate for a way to get the task id associated with this so we can use Alternatively we could add into those nodes that would give us an in-process signaling channel such as |
Description
Sleep statements should rarely be used, instead apis should allow for
blocking/non-blocking calling patterns. Attempting to remove and clean
up these statements to speed up PR workflows.
Github Action workflows for this repo were 75+ minutes, with this change 40 minutes. 47% reduction in time.
Check List
New functionality includes testingNew functionality has been documentedBy 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.