Separate ES workload from Agent spec and make it req for the scenarios#2203
Separate ES workload from Agent spec and make it req for the scenarios#2203ChrsMark merged 6 commits intoelastic:mainfrom
Conversation
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
|
This pull request does not have a backport label. Could you fix it @ChrsMark? 🙏
|
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
|
The errors are still there. If you think you need to wait before executing certain code, the tests allow you to wait for a certain condition, using a retry with backoff strategy, or more hard, using a Sleep. |
|
@mdelapenya I didn't have the time to deal with it today but the thing is that running the suite locally it doesn't fail specially with the change applied on this PR. I believe that the issue in general is that we don't properly wait until ES is started properly. Since it seems that the init container does not really help here, do we have any specific alternative leveraging the framework in order to ensure that ES is up and running before starting the scenario? Sth like: |
Let me think about it 🤔 I'll fetch this branch and try locally |
|
I think you are right, we could decouple the elasticsearch k8s resources (configMap, deployment and service) and start them before the elastic agent is started. I have two ideas:
Scenario: Logs collection from running pod
Given "elasticsearch" is running
And "elastic-agent" is running with "logs generic"
When "a pod" is deployed
Then "elastic-agent" collects events with "kubernetes.pod.name:a-pod"
|
|
Thanks for looking into this! I think I had tried already the option 1 but with no success. I will try to give it another shot. |
|
We may need to rewrite the scenario and leverage the different life cycle hooks:
|
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
|
After checking all options I will go with the basic one for now which seems simpler. Changing the suite implementation seems to me a bit overkill since we are gonna to re-use the same utils that we already have and can just work well with the current implementation of the scenario. I still believe that we can reach deadlines if ES image takes too long to get downloaded but not sure how we can handle it better. |
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
| Given "elasticsearch" is running | ||
| And "elastic-agent" is running with "logs generic" |
There was a problem hiding this comment.
We could have a single Given clause with:
Given "elastic-agent" is running with "logs generic"and define a Background clause at the beginning of the feature file:
Background: Setting up elasticsearch
Given "elasticsearch" is runningwhich will be run before every scenario. Therefore you can simplify each scenario removing the initial "Given elasticsearch" step
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
|
Great team work resolving the issue! Thanks for your time here |
|
@Mergifyio refresh |
…t req for the scenarios (#2230) * Separate ES workload from Agent spec and make it req for the scenarios (#2203) (cherry picked from commit 1e49c28) * chore: fix end-of-file * Add jq installation Co-authored-by: Chris Mark <chrismarkou92@gmail.com> Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
* main: (268 commits) bump stack version 8.2.0-ff67d7b8 (#2242) ci: periodic builds for the last two minor versions (#2241) bump stack version 8.2.0-9bac538c (#2240) fix: add end-of-file line in templates (#2237) chore: add Christos to SSH users bump stack version 8.2.0-fee3b8d2 (#2234) Separate ES workload from Agent spec and make it req for the scenarios (#2203) bump stack version 8.2.0-d02c907a (#2228) bump stack version 8.2.0-63265ec9 (#2225) fix: wrong link (#2220) chore: define provider for each test suite (#2213) ci: provision e2-small workers (#2212) bump stack version 8.2.0-a12f7069 (#2209) chore: support for Oracle Linux 8 (#2208) bump stack version 8.2.0-190af159 (#2206) bump stack version 8.2.0-fdde08ec (#2200) bump stack version 8.2.0-43df679f (#2193) chore: use trace level in logs (#2130) bump stack version 8.2.0-bdf2ad74 (#2188) feat: support downloading project artifacts for the new bucket layout (#2172) ...
* main: (72 commits) fix: always quote variables in shell scripts (elastic#2284) chore: bring back system integration scenarios (elastic#2233) chore: do not notify build green for fleet nightly builds (elastic#2277) chore: include suite, platform and tags in test reports name (elastic#2273) bump stack version 8.2.0-dcff22d7 (elastic#2270) bump stack version 8.2.0-4509f321 (elastic#2265) chore: bump Godog to v0.12.4 (elastic#2245) bump stack version 8.2.0-5cc993c1 (elastic#2254) bump stack version 8.2.0-82b803a1 (elastic#2250) fix: never process elasticsearch CI artifacts (elastic#2246) bump stack version 8.2.0-ff67d7b8 (elastic#2242) ci: periodic builds for the last two minor versions (elastic#2241) bump stack version 8.2.0-9bac538c (elastic#2240) fix: add end-of-file line in templates (elastic#2237) chore: add Christos to SSH users bump stack version 8.2.0-fee3b8d2 (elastic#2234) Separate ES workload from Agent spec and make it req for the scenarios (elastic#2203) bump stack version 8.2.0-d02c907a (elastic#2228) bump stack version 8.2.0-63265ec9 (elastic#2225) fix: wrong link (elastic#2220) ...
What does this PR do?
Separate ES workload from Agent spec and make it a requirement for the scenarios so as to ensure that deadlines because of download time are not hidden inside the scenario execution.