2 Replies Latest reply on Dec 2, 2010 12:56 PM by Kusmeroglu

    Flexunit ant task on CI Server - rundll32.exe causing problems

    Kusmeroglu

      My team is using flexunit and a CI server running Hudson. On a development system, everything runs fine, and we get the reports just like we need them. It also works fine on the CI server when just the flexunit task is run, but the build fails when the CI server tries to run a full build - the build tries to run the tests and clean to prepare for the next build, but the clean fails because there is a "rundll32.exe" process using one of the files and it can't be deleted. We tracked this process down to the one run by the flexunit task.

       

      Our task is:

       

          <target name="xci-test" depends="set-flex-coverage-home, prepare-domain-metadata-to-war, prepare-sounds-to-war, prepare-domain-metadata-for-testing, compile-unit-test-flex">
              <echo>**** The flexunit target requires that you have the standalone flash player installed and configured to run .swf files automatically! ****</echo>
              <mkdir dir="${dir.flexgui.test.output}"/>
          <!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
          <!-- Please see http://docs.flexunit.org/index.php?title=Ant_Task -->
          <flexunit workingDir="${dir.flexgui.test.output}"   
                    swf="${dir.flexgui.build.war}/${flex.swf.name}test.swf"
                    toDir="${dir.flexgui.test.output}"
                    haltonfailure="false" verbose="true" localTrusted="true"

                                  port="11028" timeout="40000"/>
              <!-- Generate readable JUnit-style reports -->
              <junitreport todir="${dir.flexgui.test.output}">
                  <fileset dir="${dir.flexgui.test.output}">
                      <include name="TEST-*.xml"/>
                  </fileset>
                  <report format="frames" todir="${dir.flexgui.test.output}/"/>
              </junitreport>
              <sleep seconds="10"/>
          </target>

       

      I can reproduce this behavior on my dev machine by running "ant xci-test clean". We tried putting a sleep in to give the process time to shut down, no change. We attempted to use the 'command' option to the flexunit task to bypass the use of rundll32.exe, but then the flash player just hangs onto the file and the clean still fails. Since "ant xci-test" followed by "ant clean" works, we also tried running ant from within ant in order to force the process to stop, but that also didn't work. Any help on this would be greatly appreciated.

       

      Thanks for your time,

      Linden

        • 1. Re: Flexunit ant task on CI Server - rundll32.exe causing problems
          legrosb Level 3

          @Linden - Have not heard of this side effect from anyone as of yet, but good to know.  Sounds like the file lock is coming from the Flash Player and causing the spawning process (rundll32.exe) to hang around as well.  The FlexUnit team runs on Hudson using the FlexUnit Ant task, but we don't seem to encounter the same issue.  What's the longest interval you've tried to use with the sleep task?  Does the FP ever release its handle to the test SWF on your development machines?

           

          Not sure this is a problem with the FlexUnit Ant task, but in 4.2 we could try to explicitly kill the rundll32 process since we'll have the PID when the task launches it.  Head on over to JIRA and file a feature request for us and I'll see what I can do in the new year.  In the short term though, maybe try upgrading your version of the stand alone debug flash player to see if that helps.  Has anyone else seen this issue?  Could you possible just move the clean target to be called before the xci-test target is run?  Just some suggestions.

           

          -Brian

          1 person found this helpful
          • 2. Re: Flexunit ant task on CI Server - rundll32.exe causing problems
            Kusmeroglu Level 1

            Brian, thanks for the quick response!

             

            I just tried 60 seconds, and it still had a lock on the file. From what I can see, as soon as the ant process stops, the process stops, but not until then. We have the latest (10.1) standalone player from adobe's site ( we just set this up last week ). I'll put a feature request in at Jira, and possibly we can switch the clean task to before each build instead of after.

             

            Thanks again,

            Linden