Skip to content

Dev mode hotTests option runs tests before server restarts #1537

Open
@turkeylurkey

Description

@turkeylurkey

Use the project guide-maven-multimodules and add SystemLivenessCheck.java to the ear module. Also add JavaEE 8.0 and MicroProfile 4.1 to the ear/pom.xml.

Start devmode with mvn liberty:devc -DhotTests on a Linux system so that changing the build file will cause the server to restart.

The test is to change the build file: ear/pom.xml. Change MicroProfile 4.1 to 3.3 and observe mphealth-2.2 is generated, the server restarts and the tests run. Then change 3.3 back to 4.1 and observe the difference. As shown in the log below mpHealth-3.1 is generated again but just as the container is stopping the tests start running. They do not pass because the server is stopped but the tests may run again when the container restarts.

[INFO] Tests will run automatically when changes are detected. You can also press the Enter key to run tests on demand.
[INFO] Running liberty:generate-features
[INFO] Generated the following features: [cdi-2.0, mpHealth-3.1, batch-1.0]
[INFO] Copied file: /home/admin/guide-maven-multimodules/finish/ear/src/main/liberty/config/configDropins/overrides/generated-features.xml to: /tmp/tempConfig6922551178765184484/configDropins/overrides/generated-features.xml
[INFO] Configuration features have been removed: [mphealth-2.2]
[INFO] Configuration features have been added: [mphealth-3.1]
[INFO] Running liberty:install-feature
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-kernel:null:22.0.0.5:zip.
[INFO] CWWKM2102I: Using installDirectory : /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : defaultServer.
[INFO] CWWKM2102I: Using serverDirectory : /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer.
[INFO] Parsing the server file for features and includes: tempConfig6922551178765184484/server.xml
[INFO] Parsing the server file for features and includes: tempConfig6922551178765184484/configDropins/overrides/generated-features.xml
[INFO] Parsing the server file for features and includes: tempConfig6922551178765184484/configDropins/overrides/liberty-plugin-variable-config.xml
[INFO] Installing features [mphealth-3.1, cdi-2.0, batch-1.0] on container liberty-dev
[INFO] Running liberty:deploy
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-kernel:null:22.0.0.5:zip.
[INFO] CWWKM2102I: Using installDirectory : /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : defaultServer.
[INFO] CWWKM2102I: Using serverDirectory : /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer.
[INFO] Copying 2 files to /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /home/admin/guide-maven-multimodules/finish/ear/src/main/liberty/config/server.xml.
[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter "appsDirectory" value defaults to "apps".
[INFO] CWWKM2160I: Installing application guide-maven-multimodules-ear.ear.xml.
[INFO] guide-maven-multimodules-war source compilation was successful.
[INFO] guide-maven-multimodules-ear tests compilation was successful.
[INFO] Copied file: /home/admin/guide-maven-multimodules/finish/ear/src/main/liberty/config/configDropins/overrides/generated-features.xml to: /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer/configDropins/overrides/generated-features.xml
[INFO] Restarting server...
[INFO] Stopping container...
[INFO] [AUDIT   ] CWWKE0085I: The server defaultServer is stopping because the JVM is exiting.
[INFO] [AUDIT   ] CWWKE1100I: Waiting for up to 30 seconds for the server to quiesce.
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://1bcc87031b6c:9080/converter/
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://1bcc87031b6c:9080/health/
[INFO] Running unit tests for guide-maven-multimodules ...
[INFO] No tests to run.
[INFO] Unit tests for guide-maven-multimodules finished.
[INFO] 
[INFO] Running integration tests for guide-maven-multimodules...
[INFO] No tests to run.
[INFO] Integration tests for guide-maven-multimodules finished.
[INFO] 
[INFO] Running unit tests for guide-maven-multimodules-jar ...
[INFO] No tests to run.
[INFO] Unit tests for guide-maven-multimodules-jar finished.
[INFO] 
[INFO] Running integration tests for guide-maven-multimodules-jar...
[INFO] No tests to run.
[INFO] Integration tests for guide-maven-multimodules-jar finished.
[INFO] 
[INFO] [AUDIT   ] CWWKZ0009I: The application guide-maven-multimodules-ear has stopped successfully.
[INFO] Running unit tests for guide-maven-multimodules-war ...
[INFO] No tests to run.
[INFO] Unit tests for guide-maven-multimodules-war finished.
[INFO] 
[INFO] CWWKM2010I: Searching for CWWKZ0003I: in /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer/logs/messages.log. This search will timeout after 30 seconds.
[INFO] [AUDIT   ] CWWKE0036I: The server defaultServer stopped after 1 minutes, 12.892 seconds.
[INFO] Running liberty:deploy
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-kernel:null:22.0.0.5:zip.
[INFO] CWWKM2102I: Using installDirectory : /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : defaultServer.
[INFO] CWWKM2102I: Using serverDirectory : /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer.
[INFO] Copying 2 files to /home/admin/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /home/admin/guide-maven-multimodules/finish/ear/src/main/liberty/config/server.xml.
[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter "appsDirectory" value defaults to "apps".
[INFO] CWWKM2160I: Installing application guide-maven-multimodules-ear.ear.xml.
[INFO] Building Docker image...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    New Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions