OpenLiberty / ci.ant

Ant tasks for managing Liberty profile server instances #devops
Apache License 2.0
8 stars 36 forks source link

.sLock file deletion failure on clean on Windows platform only #131

Open cherylking opened 3 years ago

cherylking commented 3 years ago

The WebSphere Liberty 20.0.0.9 integration tests have been failing consistently on Windows due to the following error during the clean task. Note that 20.0.0.6 and earlier did not get this error, and also Open Liberty does not get this error on any version or any platform.

[INFO] around Ant part ...... @ 4:147 in D:\a\ci.ant\ci.ant\target\it\tests\deploy-war-it\target\antrun\build-main.xml [INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) [INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) [INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) [INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) [INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) [INFO] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) [INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) [INFO] at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) [INFO] at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) [INFO] at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) [INFO] at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) [INFO] at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) [INFO] at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) [INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) [INFO] at java.lang.reflect.Method.invoke (Method.java:498) [INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) [INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) [INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) [INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [INFO] Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant BuildException has occured: The following error occurred while executing this line: [INFO] D:\a\ci.ant\ci.ant\target\it\tests\deploy-war-it\build.xml:34: CWWKM2031E: Cannot delete file D:\a\ci.ant\ci.ant\target\it\tests\install-server-it\target\wlp_output\deploy.war\workarea.sLock.

Here is a build with the failure: https://github.com/OpenLiberty/ci.ant/runs/1425836093?check_suite_focus=true#step:5:450

cherylking commented 3 years ago

Further investigation revealed this only occurs when we are using an embedded server. There is special logic in ServerTask that handles starting/stopping an embedded server. Perhaps something there needs to change in order for this file to not remain locked after the server stop command is run.

https://github.com/OpenLiberty/ci.ant/blob/master/src/main/java/io/openliberty/tools/ant/ServerTask.java#L198 https://github.com/OpenLiberty/ci.ant/blob/master/src/main/java/io/openliberty/tools/ant/ServerTask.java#L283

Also, ci.maven only tests embedded server in the basic-it test case which is not run on Open Liberty. The ci.ant integration tests are also not run on Open Liberty. So this may not just be a problem on WebSphere Liberty, but it is definitely only a problem on Windows.