You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/06/22 02:17:26 UTC

[GitHub] [kafka] stan-confluent opened a new pull request #10915: Enable connecting VS Code remote debugger

stan-confluent opened a new pull request #10915:
URL: https://github.com/apache/kafka/pull/10915


   The changes in this PR enable connecting VS Code's remote debugger to a system test running locally with ducker-ak.
   Changes include:
   - added zip_safe=False to setup.py - this enables installing kafkatest module together with source code when running `python setup.py  develop/install`.
   - install [debugpy](https://github.com/microsoft/debugpy) on ducker nodes
   - expose 5678 (default debugpy port) on ducker01 node - ducker01 is the one that actually executes tests, so that's where you'd connect to.
   - added `-d|--debug` option to `ducker-ak test` command - if used, tests will run via `python3.7 -m debugpy` command, which would listen on 5678 and pause until debugger is connected.
   - changed the logic of the `ducker-ak test` command so that ducktape args are collected separately after `--` - otherwise any argument we add to the `test` command in the future might potentially
   shadow a similar ducktape argument. 
   	- we don't really check that `ducktape_args` are args while `test_name_args` are actual test names, so the difference between the two is minimal actually - most importantly we do check that `test_name_args` is not empty, but we are ok if `ducktape_args` is.
   
   Tested: wrote a small test extending `KafkaTest` and verified it is executed with and without debug flag (to be absolutely fair, the test failed in both cases, but I was looking at whether the debugger connects correctly or not - it does). Ran it with `-- --debug` too to make sure ducktape args are passed correctly.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] omkreddy merged pull request #10915: KAFKA-13041: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
omkreddy merged pull request #10915:
URL: https://github.com/apache/kafka/pull/10915


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] stan-confluent commented on a change in pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
stan-confluent commented on a change in pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#discussion_r660083163



##########
File path: tests/README.md
##########
@@ -51,6 +51,40 @@ bash tests/docker/ducker-ak up -j 'openjdk:11'; tests/docker/run_tests.sh
 ```
 REBUILD="t" bash tests/docker/run_tests.sh
 ```
+* Debug tests in VS Code:
+  - Run test with `--debug` flag (can be before or after file name):

Review comment:
       @omkreddy I've updated the run_tests.sh file to pass ducktape args after -- if those are present, can you please take another look?
   I've also ran shellcheck and fixed the violations found in the changed bits of code.
   Thanks!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] stan-confluent commented on pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
stan-confluent commented on pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#issuecomment-875132069


   @omkreddy https://issues.apache.org/jira/browse/KAFKA-13041


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] omkreddy commented on a change in pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
omkreddy commented on a change in pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#discussion_r657466048



##########
File path: tests/README.md
##########
@@ -51,6 +51,40 @@ bash tests/docker/ducker-ak up -j 'openjdk:11'; tests/docker/run_tests.sh
 ```
 REBUILD="t" bash tests/docker/run_tests.sh
 ```
+* Debug tests in VS Code:
+  - Run test with `--debug` flag (can be before or after file name):

Review comment:
       looks like this conflicts with existing usage running tests with debug logs (check above)
   `_DUCKTAPE_OPTIONS="--debug" bash tests/docker/run_tests.sh | tee debug_logs.txt`
   
   Can we use different option to enable debugger ex: --debugpy (or) --enable-debugger 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] stan-confluent commented on a change in pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
stan-confluent commented on a change in pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#discussion_r660083163



##########
File path: tests/README.md
##########
@@ -51,6 +51,40 @@ bash tests/docker/ducker-ak up -j 'openjdk:11'; tests/docker/run_tests.sh
 ```
 REBUILD="t" bash tests/docker/run_tests.sh
 ```
+* Debug tests in VS Code:
+  - Run test with `--debug` flag (can be before or after file name):

Review comment:
       @omkreddy I've updated the run_tests.sh file to pass ducktape args after -- if those are present, can you please take another look?
   I've also ran shellcheck and fixed the violations found in the changed bits of code.
   Thanks!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] omkreddy commented on pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
omkreddy commented on pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#issuecomment-873406372


   @stan-confluent  It will be good have associated Apache Kafka JIRA.  Can you create a JIRA for this work?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] omkreddy commented on a change in pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
omkreddy commented on a change in pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#discussion_r659807251



##########
File path: tests/README.md
##########
@@ -51,6 +51,40 @@ bash tests/docker/ducker-ak up -j 'openjdk:11'; tests/docker/run_tests.sh
 ```
 REBUILD="t" bash tests/docker/run_tests.sh
 ```
+* Debug tests in VS Code:
+  - Run test with `--debug` flag (can be before or after file name):

Review comment:
       @stan-confluent I am fine with current approach. Can you update `run_tests.sh` file?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] stan-confluent commented on a change in pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
stan-confluent commented on a change in pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#discussion_r657636156



##########
File path: tests/README.md
##########
@@ -51,6 +51,40 @@ bash tests/docker/ducker-ak up -j 'openjdk:11'; tests/docker/run_tests.sh
 ```
 REBUILD="t" bash tests/docker/run_tests.sh
 ```
+* Debug tests in VS Code:
+  - Run test with `--debug` flag (can be before or after file name):

Review comment:
       We can still keep this - I do need to update run_tests.sh to pass _DUCKTAPE_OPTIONS after the `--`.
   My idea was that I didn't want to make sure the flags don't overlap between ducktape and ducker-ak, hence I changed ducker-ak to expect ducktape args after the `--` - like this `ducker-ak test my_test.py -- --ducktape-flag`. 
   I am, however, open to simply using a different flag name - it is unlikely we'll add too many flags to the ducker-ak run command anyway, so we can simply make sure they don't match the ducktape ones. 
   @omkreddy and @ewencp (with whom we had similar conversation in a different repo) - which one do you prefer?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] omkreddy commented on a change in pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
omkreddy commented on a change in pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#discussion_r659807251



##########
File path: tests/README.md
##########
@@ -51,6 +51,40 @@ bash tests/docker/ducker-ak up -j 'openjdk:11'; tests/docker/run_tests.sh
 ```
 REBUILD="t" bash tests/docker/run_tests.sh
 ```
+* Debug tests in VS Code:
+  - Run test with `--debug` flag (can be before or after file name):

Review comment:
       @stan-confluent I am fine with current approach. Can you update `run_tests.sh` file?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] stan-confluent commented on pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
stan-confluent commented on pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#issuecomment-871720727


   @omkreddy @ewencp I've also been thinking of maybe changing this so that you have two commands - `ducker-ak test` and `ducker-ak debug` - in case of `ducker-ak debug` we would still potentially want to have distinct ducker params vs ducktape params, hence the `--` would remain at least in debug command. However, it will require more coding, so I'm not convinced it is worth it honestly. Wdyt?  If you guys are happy with this PR, how can we get it merged it to trunk and backported up to 2.7 (included)? Or if any changes are needed, please let me know. 
   Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ewencp commented on a change in pull request #10915: Enable connecting VS Code remote debugger

Posted by GitBox <gi...@apache.org>.
ewencp commented on a change in pull request #10915:
URL: https://github.com/apache/kafka/pull/10915#discussion_r657638116



##########
File path: tests/README.md
##########
@@ -51,6 +51,40 @@ bash tests/docker/ducker-ak up -j 'openjdk:11'; tests/docker/run_tests.sh
 ```
 REBUILD="t" bash tests/docker/run_tests.sh
 ```
+* Debug tests in VS Code:
+  - Run test with `--debug` flag (can be before or after file name):

Review comment:
       As in other thread, I'm fine either way. I prefer just getting things to a clean, consistent state, especially since these are tests so we don't really have the same compatibility requirements. But if that creates too much overhead/confusion (especially since we need to continue running tests on older branches), this alternative approach seems acceptable even if a bit unusual.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org