-
Notifications
You must be signed in to change notification settings - Fork 244
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
Adds the debug info command #2518
Adds the debug info command #2518
Conversation
6bfc059
to
8ccf903
Compare
tests/integration/cmd_debug_test.go
Outdated
|
||
stopChannel := make(chan int) | ||
go func() { | ||
helper.CmdShouldRunAndTerminate(60*time.Second, stopChannel, "odo", "debug", "port-forward", "--local-port", "9000", "--context", context) |
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.
@mik-dass +100
Thanks for removing sleep()
@@ -42,6 +42,28 @@ func CmdShouldRunWithTimeout(timeout time.Duration, program string, args ...stri | |||
return string(session.Out.Contents()) | |||
} | |||
|
|||
// CmdShouldRunAndTerminate waits and returns stdout after a closed signal is passed on the closed channel | |||
func CmdShouldRunAndTerminate(timeoutAfter time.Duration, stopChan chan int, program string, args ...string) string { |
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.
+1
a2bae96
to
76a7fd4
Compare
Hitting test failure on windows
|
runningString := helper.CmdShouldPass("odo", "debug", "info", "--context", context) | ||
Expect(runningString).To(ContainSubstring("9000")) | ||
Expect(helper.ListFilesInDir(os.TempDir())).To(ContainElement(project + "-app" + "-nodejs-cmp-" + project + "-odo-debug.json")) | ||
stopChannel <- 0 |
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.
[odo] I0122 10:51:26.152451 6592 info.go:115] error sending signal 0 to pid 6024,
cause: not supported by windows
Details - #2518 (comment)
1776ffb
to
60cc770
Compare
Expect(runningString).To(ContainSubstring(freePort)) | ||
stopChannel <- 0 | ||
failString := helper.CmdShouldPass("odo", "debug", "info", "--context", context) | ||
Expect(failString).To(ContainSubstring("not running")) |
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.
@mik-dass Fails here
Created dir: C:\Users\Admin\AppData\Local\Temp\208489730
Creating a new project: xfvetizwbz
Running odo.exe with args [odo project create xfvetizwbz -w -v4]
[odo] - Waiting for project to come up ...
[odo] I0123 12:54:57.497491 4288 occlient.go:537] Project xfvetizwbz now exists
V Waiting for project to come up [2s]
[odo] V Project 'xfvetizwbz' is ready for use
[odo] V New project created and now using project: xfvetizwbz
Running odo.exe with args [odo component create nodejs:8 nodejs-cmp-xfvetizwbz --project xfvetizwbz --context C:\Users\Admin\AppData\Local\Temp\208489730]
V Validating component [158ms]
[odo]
[odo] Please use `odo push` command to create the component with source deployed
Running odo.exe with args [odo push --context C:\Users\Admin\AppData\Local\Temp\208489730]
[odo] Validation
V Checking component [258ms]
[odo]
[odo] Configuration changes
[odo] V Initializing component
V Creating component [741ms]
[odo]
[odo] Pushing to component nodejs-cmp-xfvetizwbz of type local
V Checking files for pushing [107ms]
V Waiting for component to start [35s]
V Syncing files to the component [17s]
V Building component [9s]
[odo] V Changes successfully pushed to component
Checking http://localhost:52540, for WebSockets request was expected
try 0 of 12
Running odo.exe with args [odo debug port-forward --local-port 52540 --context C:\Users\Admin\AppData\Local\Temp\208489730]
[odo] Started port forwarding at ports - 52540:5858
Running odo.exe with args [odo debug info --context C:\Users\Admin\AppData\Local\Temp\208489730]
[odo] Debug is running for the component on the local port : 52540
[odo]
Running odo.exe with args [odo debug info --context C:\Users\Admin\AppData\Local\Temp\208489730]
[odo] E0123 12:56:03.690735 9500 portforward.go:316] error copying from local connection to remote stream: read tcp6 [::1]:52540->[::1]:52548: wsarecv: An existing connection was forcibly closed by the remote host.
[odo] Debug is running for the component on the local port : 52540
[odo]
Deleting project: xfvetizwbz
Running odo.exe with args [odo project delete xfvetizwbz -f]
[odo] E0123 12:56:04.345777 9500 portforward.go:316] error copying from local connection to remote stream: read tcp6 [::1]:52540->[::1]:52551: wsarecv: An existing connection was forcibly closed by the remote host.
[odo] This project contains the following applications, which will be deleted
[odo] Application app
[odo] This application has following components that will be deleted
[odo] component named nodejs-cmp-xfvetizwbz
[odo] No services / could not get services
V Deleting project xfvetizwbz [6s]
[odo] V Deleted project : xfvetizwbz
Deleting dir: C:\Users\Admin\AppData\Local\Temp\208489730
------------------------------
+ Failure [77.365 seconds]
odo debug command tests
C:/Users/Admin/go/src/github.com/openshift/odo/tests/integration/cmd_debug_test.go:15
odo debug info should work on a odo component
C:/Users/Admin/go/src/github.com/openshift/odo/tests/integration/cmd_debug_test.go:70
should start a debug session and run debug info on a closed debug session [It]
C:/Users/Admin/go/src/github.com/openshift/odo/tests/integration/cmd_debug_test.go:92
Expected
<string>: Debug is running for the component on the local port : 52540
to contain substring
<string>: not running
C:/Users/Admin/go/src/github.com/openshift/odo/tests/integration/cmd_debug_test.go:111
6de4cf4
to
bac1c74
Compare
@amitkrout I have added some comments describing the problems with windows. Please have a look. |
@mik-dass Unit test is failing on travis CI - macOS. Seems your UTs changes are failing. I can see the same failure on my local macOS too |
@amitkrout I will handle that in a different PR |
@mik-dass It is not possible this to handle in a separate pr because the unit test itself is failing due to your current pr changes. we can not merge pr with Travis CI failure. If it is a necessary requirement to separate those then you can |
My PR doesn't introduce #2570 . It was introduced in #2549 (comment). The watch failure is the same I had reported there. Please have a look. So I won't fix #2570 in this PR. |
@mik-dass Thanks for the clarification. However the current issue you are facing is nothing to deal with the error that we were getting here in #2549 (comment). BTW the watch failure you are talking about has been fixed in the same pr just by using the latest stable golang version. Not sure why its again back, lets track that in separate issue - #2570 Current UTs failure -
|
I know. I reported this to you and asked you to block my PR :D
I am just clarifying I won't fix this flake in this PR as this has nothing to do with the current PR. |
/retest |
ec539fb
to
1b83b7b
Compare
@amitkrout fixed now. |
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
6 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
What type of PR is this?
Adds the debug info command
/kind feature
What does does this PR do / why we need it:
This PR adds the debug info command. It detects if a debug session is running on the component or not.
Which issue(s) this PR fixes:
Fixes #2015
How to test changes / Special notes to the reviewer: