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

How to enable Debug for integ-test ES server in elastic search #102

Closed
FreCap opened this issue Jun 2, 2021 · 4 comments
Closed

How to enable Debug for integ-test ES server in elastic search #102

FreCap opened this issue Jun 2, 2021 · 4 comments
Labels
infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc.

Comments

@FreCap
Copy link
Contributor

FreCap commented Jun 2, 2021

Running normal tests (without ES RestIntegTestTask) in intellij is very easy. We just import the project and run it it the Debug.

However I cannot find a way to run the underlying ES search server in debug mode.
I tried to add -Dcluster.debug -Dtest.debug, but it doesn't seem opening any port and the test will just run without stopping at breakpoints.

I tried to look at the code of the RestIntegTestTask gradle task (https://github.com/search?q=RestIntegTestTask&type=code), but not much insight from it.

Any advice?

@FreCap FreCap added the enhancement New feature or request label Jun 2, 2021
@FreCap
Copy link
Contributor Author

FreCap commented Jun 3, 2021

Is the only way running the tests against a separately deployed ES server?

I tried to:

@dai-chen do you have any quick hint that could save me?

@FreCap
Copy link
Contributor Author

FreCap commented Jun 3, 2021

For future reference, I found a way to make it work

Adding -Dtests.jvm.argline=-agentlib:jdwp=transport=dt_socket,server=n,address=192.168.4.64:5021,suspend=y to VM options in the intellij Debug configuration

Important, I used server=n because otherwise you need to re-attach the debugger to every ES process (keystore/plugin install, es server etc..). In this way instead you just start the debugger in LISTEN mode and it will automatically re-attach.

image

@dblock
Copy link
Member

dblock commented Jun 3, 2021

This is a good opportunity to extract a TESTING.md document similar to https://github.com/opensearch-project/OpenSearch/blob/main/TESTING.md

dai-chen pushed a commit that referenced this issue Aug 16, 2022
Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>

Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Aug 17, 2022
Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>

Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>
(cherry picked from commit 9f602c3)
@dai-chen
Copy link
Collaborator

This PR may fixed the issue. Feel free to reopen if you still face any problem. Thanks!

@dai-chen dai-chen added infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc. and removed enhancement New feature or request labels Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc.
Projects
None yet
Development

No branches or pull requests

3 participants