Closed gkwan-ibm closed 1 year ago
It blocks the new guide https://github.com/OpenLiberty/draft-guide-testcontainers.
@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?
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.
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.
@gkwan-ibm Can you give me specific recreate instructions? I need something specific for the following:
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.
hi @cherylking You can do following:
git clone https://github.com/OpenLiberty/draft-guide-testcontainers.git
https://guides-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/guides/testcontainers.html#implementing-integration-tests-to-use-testcontainers
@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.
Snapshot driver 3.10-SNAPSHOT
contains this fix. If the issue persists even with the snapshot, please reopen.
verified 3.10-SNAPSHOT
that can resolve this issue
Scenario 1:
mvn liberty:devc -DcontainerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240
Scenario 2:
mvn liberty:devc -DcontainerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240