tag:help.appveyor.com,2012-11-13:/discussions/problems/29807-ubuntu-build-is-stuck-on-test-phaseAppVeyor: Discussion 2021-07-15T14:37:56Ztag:help.appveyor.com,2012-11-13:Comment/492846482021-07-09T19:17:41Z2021-07-09T19:17:41ZUbuntu Build is stuck on test phase<div><p>I am creating a Javafx application which opens and closes windows during my tests. I am testing on Windows, Mac and Ubuntu and the build completes fine on windows and mac but always gets stuck on the first test until I have to cancel it or it stays like that for an hour and fails.</p>
<p>You can see one of my builds here: <a href="https://ci.appveyor.com/project/Marcsllite/rad-shipment-calc/builds/39932276">https://ci.appveyor.com/project/Marcsllite/rad-shipment-calc/builds...</a></p>
<p>I have tried running the tests on different Ubuntu images, removing the first test file to see if it was related to that, and adding <code>export DISPLAY=:99.0</code> like I had to for my travis builds. I looked through the discussions and couldn't find any that helped me. I believe this has something to do with needing a gui for the tests but I am not sure. Any assistance would be greatly appreciated.</p></div>marcsllitetag:help.appveyor.com,2012-11-13:Comment/492846482021-07-11T23:24:54Z2021-07-11T23:24:54ZUbuntu Build is stuck on test phase<div><p>It could be Build Agent crashes on Ubuntu, for some reason. Try enabling <a href="https://www.appveyor.com/docs/how-to/ssh-to-build-worker/">SSH</a> to the build worker and then check build agent logs:</p>
<pre>
<code>journalctl -u appveyor-build-agent -n 100</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/492846482021-07-15T14:37:47Z2021-07-15T14:37:47ZUbuntu Build is stuck on test phase<div><p>It looks like the build agent doesn't show that it crashed. I think it's a maven issue.</p>
<pre>
<code>Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: ==========================================
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: Command (hide_output: False): unset JAVA_TOOL_OPTIONS &&
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: mvn clean verify
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: ==========================================
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: Current dir: /home/appveyor/projects/rad-shipment-calc
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 : Export current directory: /home/appveyor/projects/rad-shipment-calc
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 :
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: Export current directory: /home/appveyor/projects/rad-shipment-calc
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 :
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: Export environment variables (100)
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 : Export environment variables (100)
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 :
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: Export command: unset JAVA_TOOL_OPTIONS &&
mvn clean verify
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 : Export command: unset JAVA_TOOL_OPTIONS &&
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: mvn clean verify
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 :
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: Waiting for command to complete...
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 : Waiting for command to complete...
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 :
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: Importing current directory
Jul 13 18:41:14 appveyor-vm appveyor-build-agent[698]: appveyor-build-agent Information: 0 : Importing current directory</code>
</pre>
<p>I looked into maven test freezing and followed this <a href="https://medium.com/stepstone-tech/how-to-debug-freezing-junit-tests-e43c747a533a">guide</a> i found which showed me that this is all caused by JavaFX waiting for the start of the fx thread.</p>
<p>I updated my tests to use junit 5 and started using xvfb for the display<br>
<code>Xvfb :99 & export DISPLAY=:99</code> and everything is working fine. Thanks for the assistance</p></div>marcsllite