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

LMP 3.9 devc mode does not pick up the pom.xml change #1741

Closed
gkwan-ibm opened this issue Oct 17, 2023 · 9 comments
Closed

LMP 3.9 devc mode does not pick up the pom.xml change #1741

gkwan-ibm opened this issue Oct 17, 2023 · 9 comments
Labels

Comments

@gkwan-ibm
Copy link
Member

Scenario 1:

  • used LMP 3.9 and Colima Docker on Mac
  • run mvn liberty:devc -DcontainerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240
  • add test class
  • get expected compilation error
  • update the pom.xml with the required dependencies
  • nothing change
    • expected same as Scenario 2

Scenario 2:

  • used LMP 3.8.2 and Colima Docker on Mac
  • run mvn liberty:devc -DcontainerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240
    • run 3 times for a known issue
  • add test class
  • get expected compilation error
  • update the pom.xml with the required dependencies
  • tests are recompiled
  • successfully run the tests
@gkwan-ibm
Copy link
Member Author

gkwan-ibm commented Oct 17, 2023

@cherylking
Copy link
Member

@gkwan-ibm Nothing changed in the two scenarios except the LMP version? This is very odd since nothing changed in how file changes are monitored in devc mode. What version of Maven are you using? And what version of Java?

Finally, these are direct file changes? Not through Liberty Tools correct?

@gkwan-ibm
Copy link
Member Author

mvn -version
Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)
Maven home: /Users/gkwan/tasks/softwares/apache-maven-3.9.1
Java version: 11.0.20.1, vendor: IBM Corporation, runtime: /Users/gkwan/tasks/softwares/jdk-11.0.20.1+1.semeru.aarch64/Contents/Home
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "14.0", arch: "aarch64", family: "mac"

Yes, direct file changes. Not through LT.

@cherylking cherylking added the bug label Oct 17, 2023
@cherylking
Copy link
Member

I am wondering if this change caused this problem. I will build a snapshot with that change backed out and see if it fixes it. If so, I will need to determine a different fix for the original problem.

@cherylking
Copy link
Member

@gkwan-ibm Can you give me specific recreate instructions? I need something specific for the following:

  • add test class
  • get expected compilation error
  • update the pom.xml with the required dependencies

Also, can you check if the same scenario fails for dev vs devc? I tried to recreate with one of my sample projects locally, but without a specific test class and dependency to add, I am spinning my wheels.

@gkwan-ibm
Copy link
Member Author

hi @cherylking You can do following:

  • git clone https://github.com/OpenLiberty/draft-guide-testcontainers.git
  • visit https://guides-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/guides/testcontainers.html#implementing-integration-tests-to-use-testcontainers
  • follow the instructions in the guide
  • after replacing the pom.xml, expect test classes are compiled, and hit enter to run the tests successfully

@cherylking
Copy link
Member

@gkwan-ibm fyi...if you run this same scenario on 3.8.2 with -DpollingTest, you would get the same incorrect behavior. There were two issues here.

  1. For some reason, when trying to get events from the file watcher, it is taking too long and therefore defaulting to use polling instead in the 3.9 version of the plugin.
  2. There was some incorrect logic in the polling method that caused some files (including build files) to not get monitored correctly.

For 1, I have increased the timeout so that there is a better chance that file watching will occur instead of polling.
For 2, I fixed the logic to handle monitoring of all files correctly.

This fix will be contained in the next release of the plugin. Once a snapshot is available for testing, I will close this issue.

@cherylking
Copy link
Member

Snapshot driver 3.10-SNAPSHOT contains this fix. If the issue persists even with the snapshot, please reopen.

@gkwan-ibm
Copy link
Member Author

verified 3.10-SNAPSHOT that can resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants