eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

Investigate reason of failing tests on debugger package on CI #8105

Closed musienko-maxim closed 6 years ago

musienko-maxim commented 6 years ago

Description

The test checks debugging feature with Simple web application that runs in a workplace based on java stack. But sometimes in the rare specific cases the variable under debugging does not highlighted red color in the breakpoint place. So, it looks like the webapplication in certain cases does not respond. We should try to catch this problem and find solution for this one. Because this brings unstability in the test. The similar problem has next tests:

OS and version:
Che, master 6.0.0-M4

musienko-maxim commented 6 years ago

I have next suspectation: sometimes on CI a test - web application does not launch properly. For example: This error may produce unstable in test from the debugger package and intelligence command package. For getting more information for developers, we should try to provide stack trace from console of the application. As possible variant we can grab the console output and write to warning log after failing a test.

musienko-maxim commented 6 years ago

After adding of check PID of run app. looks like depended PIDs work as well. More info in PR: https://github.com/eclipse/che/pull/8546. I think we should apply other strategy (i suppose - we have errors in the ws-agent logs after this problem. We should get error trace.)

musienko-maxim commented 6 years ago

So after 20 iterations on local env. i reproduced this bug. I try to set breakpoints and reproduce this bug again.

dmytro-ndp commented 6 years ago

There were next reasons of debugger test failures:

Too small timeouts

java.lang.RuntimeException: java.lang.Exception: Cannot do request for application: 504

504 Gateway Time-out

The server didn't respond in time.

at org.eclipse.che.selenium.debugger.DebuggerUtils.lambda$gotoDebugAppAndSendRequest$0(DebuggerUtils.java:59)

...

- in the CodenyEditor and DebugPanel page objects in methods related to debugger (10 or 20 seconds), [for example](https://ci.codenvycorp.com/view/qa/job/che-integration-tests-master-docker/195/testReport/org.eclipse.che.selenium.debugger/StepIntoStepOverStepReturnWithChangeVariableTest/changeVariableTest/):

java.lang.AssertionError: Known issue: https://github.com/eclipse/che/issues/8105 at org.testng.Assert.fail(Assert.java:83) at org.eclipse.che.selenium.debugger.StepIntoStepOverStepReturnWithChangeVariableTest.changeVariableTest(StepIntoStepOverStepReturnWithChangeVariableTest.java:149) ... Caused by: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for presence of any elements located by By.xpath: //div[@id='gwt-debug-editorPartStack-contentPanel']//div[@active]//div[@class='textviewContent' and @contenteditable='true']//span[@debugid='debug-line'] (tried for 20 second(s) with 500 MILLISECONDS interval) Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700' System info: host: 'slave2.codenvycorp.com', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.16.1.el7.x86_64', java.version: '1.8.0_102' Driver info: org.eclipse.che.selenium.core.SeleniumWebDriver at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:80) at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:265) at org.eclipse.che.selenium.pageobject.debug.DebugPanel.waitDebugHighlightedText(DebugPanel.java:359)

- test Web application execution doesn't stop at the breakpoint line, [for example](https://ci.codenvycorp.com/view/qa-experimental/job/experimental-che-integration-tests-multiuser-master-ocp/64/consoleText):

2018-03-17 12:23:56,825[main] [WARN ] [o.e.c.s.p.m.MachineTerminal 336] - @@@ Web application info: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND user 494 0.0 0.0 19732 1556 ? Ss 12:22 0:00 /bin/bash -c cp /projects/projectuh61/target/qa-spring-sample-1.0-SNAPSHOT.war /home/user/tomcat8/webapps/ROOT.war && /home/user/tomcat8/bin/catalina.sh jpda run 2018-03-17 12:23:56,826[main] [INFO ] [epReturnWithChangeVariableTest 155] - Application response content:

Enter number:
Congrats! The number is 6
... [ERROR] changeVariableTest(org.eclipse.che.selenium.debugger.StepIntoStepOverStepReturnWithChangeVariableTest) Time elapsed: 129.911 s <<< FAILURE! java.lang.AssertionError: Known issue: https://github.com/eclipse/che/issues/8105 at org.eclipse.che.selenium.debugger.StepIntoStepOverStepReturnWithChangeVariableTest.changeVariableTest(StepIntoStepOverStepReturnWithChangeVariableTest.java:156) Caused by: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for presence of any elements located by By.xpath: //div[@id='gwt-debug-editorPartStack-contentPanel']//div[@active]//div[@class='textviewContent' and @contenteditable='true']//span[@debugid='debug-line'] (tried for 60 second(s) with 500 MILLISECONDS interval) Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700' System info: host: 'slave7.codenvycorp.com', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.16.1.el7.x86_64', java.version: '1.8.0_102' Driver info: org.eclipse.che.selenium.core.SeleniumWebDriver at org.eclipse.che.selenium.debugger.StepIntoStepOverStepReturnWithChangeVariableTest.changeVariableTest(StepIntoStepOverStepReturnWithChangeVariableTest.java:151)