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

Get back to the Welcome screen at start up of UI test #1135

Merged
merged 3 commits into from
Nov 29, 2024

Conversation

turkeylurkey
Copy link
Member

@turkeylurkey turkeylurkey commented Nov 26, 2024

Fixes #1124

Introduce a new method to find the Welcome screen of IntelliJ. This is needed when we start IntelliJ after a crash. In this case IntelliJ will start and load the last project that was used. This is not expected by the UI robot because it always closes files and projects after each test. So the fix is to close all files and lose the current project to get back to the Welcome screen when we detect that the Welcome screen is not up.

I also noticed that there were some unused imports so I did a sweep through all the files in the directory and updated the copyrights, removed unused imports and also extra blank lines.

@turkeylurkey turkeylurkey self-assigned this Nov 26, 2024
@turkeylurkey
Copy link
Member Author

Test results for Mac. 5 failures. The first 4 were similar but not the same. The first two were the same. The second two were the same.

1. 

GradleSingleModMPLSTest > testDiagnosticInMicroProfileConfigProperties() STANDARD_OUT
    INFO: 2024-11-26T *22:32:28* .920738: GradleSingleModMPLSTest.testDiagnosticInMicroProfileConfigProperties(). Entry
    Type mismatch: boolean expected. By default, this value will be interpreted as 'false'
     microprofile (value)
    INFO: 2024-11-26T22:34:42.550085: GradleSingleModMPLSTest.testDiagnosticInMicroProfileConfigProperties(). Exit

GradleSingleModMPLSTest > testDiagnosticInMicroProfileConfigProperties() FAILED
    java.net.SocketTimeoutException: Read timed out
        at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:288)
        at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:314)
        at java.base/sun.nio.ch
...
        at com.intellij.remoterobot.fixtures.ContainerFixture.find(ContainerFixture.kt:12)
        at io.openliberty.tools.intellij.it.fixtures.ProjectFrameFixture.getActionMenu(ProjectFrameFixture.java:66)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.pasteOnActiveWindow(UIBotTestUtils.java:1509)
        at io.openliberty.tools.intellij.it.SingleModMPLSTestCommon.testDiagnosticInMicroProfileConfigProperties(SingleModMPLSTestCommon.java:275)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


2. 

GradleSingleModMPLSTest > testDiagnosticInMicroProfileConfigProperties() STANDARD_OUT
    INFO: 2024-11-26T *23:32:32* .363554: GradleSingleModMPLSTest.testDiagnosticInMicroProfileConfigProperties(). Entry
    Type mismatch: boolean expected. By default, this value will be interpreted as 'false'
     microprofile (value)
    INFO: 2024-11-26T23:34:29.664765: GradleSingleModMPLSTest.testDiagnosticInMicroProfileConfigProperties(). Exit

GradleSingleModMPLSTest > testDiagnosticInMicroProfileConfigProperties() FAILED
    java.net.SocketTimeoutException: Read timed out
        at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:288)
        at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:314)
        at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:355)
        at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:808)
        at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
   ...
        at com.intellij.remoterobot.fixtures.ContainerFixture.find(ContainerFixture.kt:12)
        at io.openliberty.tools.intellij.it.fixtures.ProjectFrameFixture.getActionMenu(ProjectFrameFixture.java:66)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.pasteOnActiveWindow(UIBotTestUtils.java:1509)
        at io.openliberty.tools.intellij.it.SingleModMPLSTestCommon.testDiagnosticInMicroProfileConfigProperties(SingleModMPLSTestCommon.java:275)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


3. 

GradleSingleModMPLSTest > testQuickFixInMicroProfileConfigProperties() STANDARD_OUT
    INFO: 2024-11-27T *00:26:31* .660308: GradleSingleModMPLSTest.testQuickFixInMicroProfileConfigProperties(). Entry
    INFO: 2024-11-27T00:28:11.785347: GradleSingleModMPLSTest.testQuickFixInMicroProfileConfigProperties(). Exit

GradleSingleModMPLSTest > testQuickFixInMicroProfileConfigProperties() FAILED
    java.net.SocketTimeoutException: Read timed out
        at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:288)
        at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:314)
        at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:355)
        at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:808)
 ...
        at com.intellij.remoterobot.RemoteRobot.isMac(RemoteRobot.kt:61)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.goToLineAndColumn(UIBotTestUtils.java:1357)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.pasteOnActiveWindow(UIBotTestUtils.java:1491)
        at io.openliberty.tools.intellij.it.SingleModMPLSTestCommon.testQuickFixInMicroProfileConfigProperties(SingleModMPLSTestCommon.java:313)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


 4. 

 GradleSingleModMPLSTest > testQuickFixInMicroProfileConfigProperties() STANDARD_OUT
    INFO: 2024-11-27T *01:24:22* .454579: GradleSingleModMPLSTest.testQuickFixInMicroProfileConfigProperties(). Entry
    INFO: 2024-11-27T01:26:07.610941: GradleSingleModMPLSTest.testQuickFixInMicroProfileConfigProperties(). Exit

GradleSingleModMPLSTest > testQuickFixInMicroProfileConfigProperties() FAILED
    java.net.SocketTimeoutException: Read timed out
        at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:288)
        at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:314)
        at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:355)
        at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:808)
        at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
        at okio.InputStreamSource.read(JvmOkio.kt:93)
 ...
        at com.intellij.remoterobot.RemoteRobot.isMac(RemoteRobot.kt:61)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.goToLineAndColumn(UIBotTestUtils.java:1357)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.pasteOnActiveWindow(UIBotTestUtils.java:1491)
        at io.openliberty.tools.intellij.it.SingleModMPLSTestCommon.testQuickFixInMicroProfileConfigProperties(SingleModMPLSTestCommon.java:313)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 

5. 

JakartaWebSocketTest > addPathParamsAnnotation STANDARD_ERROR
    [ 938755]   WARN - #o.j.i.maven - updateAllMavenProjects started: incremental=true, MavenProjectsManagerEx.addManagedFilesWithProfilesAndUpdate addPathParamsAnnotation
    [ 938775]   WARN - #o.j.i.maven - ImportLogging. pomReadingStarted (1)
    [ 940468]   WARN - #o.j.i.maven - ImportLogging. pomReadingFinished (1)
    [ 945510]   WARN - #o.j.i.maven - ImportLogging. importStarted (1)
    [ 945528]   WARN - #o.j.i.maven - Can't migrate the project to external project files storage: Project.isExternalStorageEnabled=false
    [ 945860]   WARN - #o.j.i.maven - ImportLogging. importFinished (1): 1, 1
    [ 945866]   WARN - #o.j.i.maven - ImportLogging. pluginResolutionStarted (1)
    [ 945867]   WARN - #o.j.i.maven - ImportLogging. pluginResolutionFinished (1)
    [ 945869]   WARN - #o.j.i.maven - updateAllMavenProjects finished: incremental=true, MavenProjectsManagerEx.addManagedFilesWithProfilesAndUpdate addPathParamsAnnotation

GradleSingleModJakartaLSTest > initializationError FAILED
    com.intellij.remoterobot.utils.WaitForConditionTimeoutException: Exceeded timeout (PT10S) for condition function (Failed to find 'ComponentFixture' by '//div[@class='ActionMenu' and @text='Window']//div[@class='ActionMenu' and @text='Editor Tabs']' in 10s) 
        at com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor(RepeatUtils.kt:51)
        at com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor$default(RepeatUtils.kt:37)
        at com.intellij.remoterobot.SearchContext$find$1.invoke(SearchContext.kt:53)
        at com.intellij.remoterobot.SearchContext$find$1.invoke(SearchContext.kt:51)
        at com.intellij.remoterobot.stepsProcessing.StepWorkerKt.step(StepWorker.kt:23)
        at com.intellij.remoterobot.SearchContext$DefaultImpls.find(SearchContext.kt:51)
        at com.intellij.remoterobot.fixtures.ContainerFixture.find(ContainerFixture.kt:12)
        at io.openliberty.tools.intellij.it.fixtures.ProjectFrameFixture.getChildActionMenu(ProjectFrameFixture.java:98)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.closeAllEditorTabs(UIBotTestUtils.java:749)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.findWelcomeFrame(UIBotTestUtils.java:2543)
        at io.openliberty.tools.intellij.it.SingleModJakartaLSTestCommon.prepareEnv(SingleModJakartaLSTestCommon.java:186)
        at io.openliberty.tools.intellij.it.GradleSingleModJakartaLSTest.setup(GradleSingleModJakartaLSTest.java:40)

GradleSingleModLSTest > initializationError FAILED
    com.intellij.remoterobot.utils.WaitForConditionTimeoutException: Exceeded timeout (PT10S) for condition function (Failed to find 'ComponentFixture' by '//div[@class='ActionMenu' and @text='Window']//div[@class='ActionMenu' and @text='Editor Tabs']' in 10s) 
        at com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor(RepeatUtils.kt:51)
        at com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor$default(RepeatUtils.kt:37)
        at com.intellij.remoterobot.SearchContext$find$1.invoke(SearchContext.kt:53)
        at com.intellij.remoterobot.SearchContext$find$1.invoke(SearchContext.kt:51)
        at com.intellij.remoterobot.stepsProcessing.StepWorkerKt.step(StepWorker.kt:23)
        at com.intellij.remoterobot.SearchContext$DefaultImpls.find(SearchContext.kt:51)
        at com.intellij.remoterobot.fixtures.ContainerFixture.find(ContainerFixture.kt:12)
        at io.openliberty.tools.intellij.it.fixtures.ProjectFrameFixture.getChildActionMenu(ProjectFrameFixture.java:98)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.closeAllEditorTabs(UIBotTestUtils.java:749)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.findWelcomeFrame(UIBotTestUtils.java:2543)
        at io.openliberty.tools.intellij.it.SingleModLibertyLSTestCommon.prepareEnv(SingleModLibertyLSTestCommon.java:398)
        at io.openliberty.tools.intellij.it.GradleSingleModLSTest.setup(GradleSingleModLSTest.java:40)

GradleSingleModMPLSTest > initializationError FAILED
    com.intellij.remoterobot.utils.WaitForConditionTimeoutException: Exceeded timeout (PT10S) for condition function (Failed to find 'ComponentFixture' by '//div[@class='ActionMenu' and @text='Window']//div[@class='ActionMenu' and @text='Editor Tabs']' in 10s) 
        at com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor(RepeatUtils.kt:51)
        at com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor$default(RepeatUtils.kt:37)
        at com.intellij.remoterobot.SearchContext$find$1.invoke(SearchContext.kt:53)
        at com.intellij.remoterobot.SearchContext$find$1.invoke(SearchContext.kt:51)
        at com.intellij.remoterobot.stepsProcessing.StepWorkerKt.step(StepWorker.kt:23)
        at com.intellij.remoterobot.SearchContext$DefaultImpls.find(SearchContext.kt:51)
        at com.intellij.remoterobot.fixtures.ContainerFixture.find(ContainerFixture.kt:12)
        at io.openliberty.tools.intellij.it.fixtures.ProjectFrameFixture.getChildActionMenu(ProjectFrameFixture.java:98)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.closeAllEditorTabs(UIBotTestUtils.java:749)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.findWelcomeFrame(UIBotTestUtils.java:2543)
        at io.openliberty.tools.intellij.it.SingleModMPLSTestCommon.prepareEnv(SingleModMPLSTestCommon.java:327)
        at io.openliberty.tools.intellij.it.GradleSingleModMPLSTest.setup(GradleSingleModMPLSTest.java:41)

GradleSingleModMPProjectTest STANDARD_OUT
    INFO: 2024-11-27T01:52:27.451473: prepareEnv. Entry. ProjectPath: /Users/runner/work/liberty-tools-intellij/liberty-tools-intellij/liberty-tools-intellij/src/test/resources/projects/gradle. ProjectName: singleModGradleMP
    INFO: 2024-11-27T01:52:52.559631: UIBotTestUtils.openProjectView Entry
    INFO: 2024-11-27T01:53:03.259262: UIBotTestUtils.openProjectView Exit
    INFO: 2024-11-27T01:53:03.259777: UIBotTestUtils.waitForIndexing Entry
    INFO: 2024-11-27T01:54:03.758775: UIBotTestUtils.waitForIndexing Exit
    INFO: 2024-11-27T01:55:17.396531: prepareEnv. Exit. ProjectName: singleModGradleMP

GradleSingleModMPProjectTest > testCustomStartParametersClearedOnConfigRemoval() STANDARD_OUT
    INFO: 2024-11-27T01:55:17.525613: GradleSingleModMPProjectTest.testCustomStartParametersClearedOnConfigRemoval(). Entry

GradleSingleModMPProjectTest > testCustomStartParametersClearedOnConfigRemoval() FAILED
    com.intellij.remoterobot.utils.WaitForConditionTimeoutException: Exceeded timeout (PT16S) for condition function (Menu items containing the Edit Configurations... text were not found) 
        at com.intellij.remoterobot.utils.RepeatUtilsKt$waitFor$2.invoke(RepeatUtils.kt:47)
        at com.intellij.remoterobot.utils.RepeatUtilsKt$waitFor$2.invoke(RepeatUtils.kt:45)
        at com.intellij.remoterobot.stepsProcessing.StepWorkerKt.step(StepWorker.kt:23)
        at com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor(RepeatUtils.kt:45)
        at com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor(RepeatUtils.kt:33)
        at io.openliberty.tools.intellij.it.fixtures.ProjectFrameFixture.getActionMenuItem(ProjectFrameFixture.java:79)
        at io.openliberty.tools.intellij.it.UIBotTestUtils.deleteLibertyRunConfigurations(UIBotTestUtils.java:2204)
        at io.openliberty.tools.intellij.it.SingleModMPProjectTestCommon.testCustomStartParametersClearedOnConfigRemoval(SingleModMPProjectTestCommon.java:1166)
    

Copy link
Contributor

@mrglavas mrglavas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks.

src/test/resources/ci/scripts/run.sh Show resolved Hide resolved
Copy link
Contributor

@vaisakhkannan vaisakhkannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks @turkeylurkey . Please ensure the builds are passing

@turkeylurkey
Copy link
Member Author

The Mac failure demonstrated one thing: the first run suffered a SocketTimeoutException but it was aborted by the code in this series of fixes after one hour (not 3hrs for a full run). The failures in the second run look like mouse clicks were not transmitted.

@turkeylurkey
Copy link
Member Author

Windows failed trying to debug the server. 148 tests completed, 6 failed, 16 skipped but just one movie.

@turkeylurkey turkeylurkey merged commit 47e9a4e into OpenLiberty:main Nov 29, 2024
1 of 3 checks passed
@turkeylurkey turkeylurkey deleted the issue-1124 branch November 29, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Mac automated UI test failure: SocketTimeoutException, restart testing on new environment
3 participants