29 Replies Latest reply on Apr 7, 2010 12:52 AM by mech-head

    CI issues on Linux - CentOS + Hudson

    dguebel
      Hi there,

      I got some issues to generate the Junit reports, it gets up to "Waiting for client connection" then do nothing for a few seconds.
      When it gets back this is what I get in the console:

      runUnitTests:

           [java] Loading configuration file /opt/flex/frameworks/flex-config.xml

           [java] Failed to match the compile target with /root/.hudson/jobs/myProject_Continuous_Build/workspace/trunk/bin/TMCV6TestRunner.swf.cache. The cache file will not be reused.

           [java] /root/.hudson/jobs/myProject_Continuous_Build/workspace/trunk/bin/TMCV6TestRunner.swf (1582916 bytes)

      [flexunit] Validating task attributes ...

      [flexunit] Generating default values ...

      [flexunit] Using default snapshot file path [/root/.hudson/jobs/myProject_Continuous_Build/workspace/trunk/bin/logs/unitTestReport/snapshot.jpg]

      [flexunit] Using the following settings:

      [flexunit]      haltonfailure: [true]

      [flexunit]      headless: [true]

      [flexunit]      localTrusted: [true]

      [flexunit]      player: [flash]

      [flexunit]      port: [1024]

      [flexunit]      snapshot: [false]

      [flexunit]      snapshotFile: [/root/.hudson/jobs/myProject_Continuous_Build/workspace/trunk/bin/logs/unitTestReport/snapshot.jpg]

      [flexunit]      swf: [/root/.hudson/jobs/myProject_Continuous_Build/workspace/trunk/bin/TMCV6TestRunner.swf]

      [flexunit]      timeout: [60000ms]

      [flexunit]      toDir: [/root/.hudson/jobs/myProject_Continuous_Build/workspace/trunk/bin/logs/unitTestReport]

      [flexunit]      verbose: [true]

      [flexunit]      xcommand: [xvfb]

      [flexunit] Setting up server process ...

      [flexunit] OS: [Unix]

      [flexunit] Launching player:

      [flexunit] Executing 'gflashplayer' with arguments:

      [flexunit] '/root/.hudson/jobs/myProject_Continuous_Build/workspace/trunk/bin/TMCV6TestRunner.swf'

      [flexunit]

      [flexunit] The ' characters around the executable and arguments are

      [flexunit] not part of the command.

      [flexunit]

      [flexunit] Created local trust file at [/root/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg]

      [flexunit] Starting server ...

      [flexunit] Opening server socket on port [1024].

      [flexunit] Waiting for client connection ...

      [flexunit]

      [flexunit] Stopping server ...

      [flexunit] End of test data reached, sending acknowledgement to player ...

      [flexunit] Closing client connection ...

      [flexunit] Closing server on port [1024] ...

      It halts there unless I cancel the build, in that case I get the following in the console:


      Terminating xvnc.

      [workspace] $ vncserver -kill :99



      BUILD FAILED

      java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report

           at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)

           at java.util.concurrent.FutureTask.get(FutureTask.java:83)

           at org.flexunit.ant.tasks.FlexUnitTask.execute(Unknown Source)

           at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

           at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

           at java.lang.reflect.Method.invoke(Method.java:597)

           at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

           at org.apache.tools.ant.Task.perform(Task.java:348)

           at org.apache.tools.ant.Target.execute(Target.java:357)

           at org.apache.tools.ant.Target.performTasks(Target.java:385)

           at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)

           at org.apache.tools.ant.Project.executeTarget(Project.java:1306)

           at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

           at org.apache.tools.ant.Project.executeTargets(Project.java:1189)

           at org.apache.tools.ant.Main.runBuild(Main.java:758)

           at org.apache.tools.ant.Main.startAnt(Main.java:217)

           at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)

           at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

      Caused by: Socket timeout waiting for flexunit report

           at org.flexunit.ant.FlexUnitSocketServer.start(Unknown Source)

           at org.flexunit.ant.FlexUnitSocketThread.call(Unknown Source)

           at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

           at java.util.concurrent.FutureTask.run(FutureTask.java:138)

           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

           at java.lang.Thread.run(Thread.java:619)

      Caused by: java.net.SocketTimeoutException: Accept timed out

           at java.net.PlainSocketImpl.socketAccept(Native Method)

           at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)

           at java.net.ServerSocket.implAccept(ServerSocket.java:453)

           at java.net.ServerSocket.accept(ServerSocket.java:421)

           at org.flexunit.ant.FlexUnitSocketServer.openClientSocket(Unknown Source)

           ... 7 more



      Total time: 10 minutes 49 seconds

      Killing Xvnc process ID 4490

      Build was aborted

      Recording test results

      No test report files were found. Configuration error?

      Finished: ABORTED


      I'm using CentOS and Hudson.

      Any help will be appreciated.

      Thanks in advance,
      Diego
        • 1. Re: CI issues on Linux - CentOS + Hudson
          legrosb Level 3

          @dguebel - Based on the output in your post, it looks like the Ant task is spinning up the server to listen for the Flash movie which will run the tests, but the movie is not transmitting the appropriate handshake to start the communication.  Could you post the code from your test runner and build script so we can look at in more detail?  Here are some suggestions based on my experience:

           

          - Make sure that you add the CIListener class to the core as a listener so this handshake can take place from the Flash movie.

          - Make sure that the X-Windows is installed and that you are able to launch the flash player using the gflashplayer symlink while logged in under the windowing environment.  Typically not having the correct dependencies installed will result in a Segmentation Fault error from my experiences. 

          - Try attaching to display :99 with a vnc client to see if an error message is being output and if the FP is opening before the server timeout occurs. This may have more clues to help.

           

          I've only tested on my Ubuntu distro and am not a Linux pro, but I know there are others out there using CentOS and the Ant task successfully.  Maybe they could offer some suggestions.

           

          -Brian

          • 2. Re: CI issues on Linux - CentOS + Hudson
            dguebel Level 1

            Hi Brian,

             

            Many thanks for your reply,

             

            I'll reply inline:

             

            - Make sure that you add the CIListener class to the core as a listener so this handshake can take place from the Flash movie.

             

            This is how my Main file looks like:

             

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                                            xmlns:flexUnitUIRunner="http://www.adobe.com/2009/flexUnitUIRunner"
                                            creationComplete="creationCompleteHandler()">

             

                    <mx:Script>
                            <![CDATA[
                                    import org.flexunit.listeners.CIListener;
                                    import au.com.infomedia.tmcV6.TMCV6Suite;
                                    import au.com.infomedia.V6.V6Suite;
                                    import org.flexunit.listeners.UIListener;
                                    import org.flexunit.runner.FlexUnitCore;

             

                                    private var core:FlexUnitCore;

             

                                    public function creationCompleteHandler():void
                                    {
                                            core = new FlexUnitCore();
                                            core.addListener(new CIListener());
                                            core.addListener(new UIListener(uiListener));
                                            core.run(V6Suite, TMCV6Suite);
                                    }
                            ]]>
                    </mx:Script>

             

                    <flexUnitUIRunner:TestRunnerBase id="uiListener" width="100%" height="100%" />

             

            </mx:Application>

             

            - Make sure that the X-Windows is installed and that you are able to launch the flash player using the gflashplayer symlink while logged in under the windowing environment.  Typically not having the correct dependencies installed will result in a Segmentation Fault error from my experiences.

             

            I run vncserver and viewer by command line and I'm able to run gflashplayer inside the window.

             

            [root@uibuild build]# vncserver :99

             

            New 'uibuild.devsyd.com:99 (root)' desktop is uibuild.devsyd.com:99

             

            Starting applications specified in /root/.vnc/xstartup
            Log file is /root/.vnc/uibuild.devsyd.com:99.log

             

            [root@uibuild build]# vncviewer :99

             

            VNC Viewer Free Edition 4.1.2 for X - built Mar 24 2009 19:52:30
            Copyright (C) 2002-2005 RealVNC Ltd.
            See http://www.realvnc.com for information on VNC.

             

            Mon Jan 11 17:28:11 2010
            CConn:       connected to host localhost port 5999
            CConnection: Server supports RFB protocol version 3.8
            CConnection: Using RFB protocol version 3.8

             

            Mon Jan 11 17:28:27 2010
            TXImage:     Using default colormap and visual, TrueColor, depth 24.
            CConn:       Using pixel format depth 6 (8bpp) rgb222
            CConn:       Using ZRLE encoding

             

             

            - Try attaching to display :99 with a vnc client to see if an error message is being output and if the FP is opening before the server timeout occurs. This may have more clues to help.

             

            I'm pointing to display :99 in Hudson, but you made me wonder, should Hudson open up the standalone player as Windows does, or it should run in the background as a different process?

             

            I already tried setting up localTrusted and headless to true and false.

             

            This is the ANT target I'm using to run the unit tests:

             

                   <!-- =================================
                      target: runUnitTests
                     ================================= -->
                <target name="runUnitTests" description="Runs Unit Tests and creates JUnit reports">

             

                    <mkdir dir="${unitTestReport.dir}"/>

             

                    <compile.flex in="${flex.test.dir}/${testRunner.name}.mxml" out="${build.dir}/${testRunner.name}.swf" failonerror="true" targetPlayer="${target.flash.player}"
                                            additional="-source-path+='${flex.src.dir},${flex.test.dir}' -compiler.verbose-stacktraces='true' -compiler.headless-server='true'"/>

             

                    <flexunit swf="${build.dir}/${testRunner.name}.swf" toDir="${unitTestReport.dir}" haltonfailure="true"
            verbose="true" localTrusted="false" headless="true"/>

             

                            <junitreport todir="${unitTestReport.dir}">
                                    <fileset dir="${unitTestReport.dir}">
                                    <include name="TEST-*.xml"/>
                                    </fileset>

             

                                    <report format="frames" todir="${unitTestReport.dir}/html"/>
                            </junitreport>

             

                </target>

             

                 <!--  =================================

                          macrodef: compile.flex
                         ================================= -->
                    <macrodef name="compile.flex">
                            <attribute name="flexHome" default="${flex.home}"/>
                            <attribute name="backgroundColor" default="#FFFFFF"/>
                            <attribute name="incremental" default="true"/>
                            <attribute name="optimize" default="true"/>
                            <attribute name="strict" default="true"/>
                            <attribute name="targetPlayer"/>
                            <attribute name="useNetwork" default="true"/>
                            <attribute name="in"/>
                            <attribute name="out"/>
                            <attribute name="failonerror" default="true"/>
                            <attribute name="additional" default=""/>

             

                            <sequential>
                                    <java jar="@{flexHome}/lib/mxmlc.jar" fork="true" maxmemory="512m" failonerror="@{failonerror}" resultproperty="buildResultProperty">

             

                                            <jvmarg line="-Xms32m -Xmx768m -Dsun.io.useCanonCaches=false"/>

             

                                            <!-- Add metadata -->
                                            <arg value="-title=${title}"/>
                                            <arg value="-publisher=${publisher}"/>
                                            <arg value="-creator=${creator}"/>
                                            <arg value="-language=${language}"/>

             

                                            <!-- Compiler arguments -->
                                            <arg value="+flexlib=@{flexHome}/frameworks"/>
                                            <arg value="-library-path+=${basedir}/libs"/>
                                            <arg value="-default-background-color=@{backgroundColor}"/>
                                            <arg value="-incremental=@{incremental}"/>
                                            <arg value="-optimize=@{optimize}"/>
                                            <arg value="-strict=@{strict}"/>
                                            <arg value="-use-network=@{useNetwork}"/>
                                            <arg value="-target-player=@{targetPlayer}"/>
                                            <arg value="-output=@{out}" />
                                            <arg line="@{additional}" />
                                            <arg value="@{in}" />
                                    </java>
                            </sequential>
                    </macrodef>

             

             

            Thanks again for your help,

            Diego

            • 3. Re: CI issues on Linux - CentOS + Hudson
              legrosb Level 3

              @dguebel - In looking at your build and setup and things look ok.  Couple of suggestions:

               

              - Keep localTrusted at true, some people have complained that localTrusted at false causes issues.

               

              - Turn off the incremental flag on the compiler, since it's a CI build, it should build everything from scratch on each run to verify the integrity of the entire build.

               

              - The impl for the headless attribute to the flexunit task has not deployed as of yet but when it is, it will emulate the functionality of the xvnc plugin for Hudson, so you should ommit this attribute.

               

              - I know from some recent headaches with CentOS, the built-in firewall is turned on by default after install.  You may want to verify that socket connections on port 1024 are allowed and that port is open.

               

              - Still try to attach to display :99 using a vnc client.  The Flash Player requires a windowed environment to execute regardless of the OS.  Currently no headless player exists, hence the need for the xvnc plugin to emulate a windowing environment so the Flash Player can execute correctly.  You could try rolling xvfb-run in your own custom call to lauch the ant script, but I don't think XVnc is the issue since it seems to be running successfully.

               

              Outside of these suggestions, I can't really offer much more help; maybe you can appeal to users of the forums and see who else can lend their two cents.  Let me know how it goes.

               

              -Brian

              • 4. Re: CI issues on Linux - CentOS + Hudson
                dguebel Level 1

                Hi Brian,

                 

                Thanks again for your reply,

                 

                I run system-config-securitylevel by command line and can confirm that the Firewall is disabled, I'll keep investigating this to find out whats wrong.

                 

                I'd appreciate if anyone else running Hudson on CentOS can shed some light on this.

                 

                Cheers,

                Diego

                • 5. Re: CI issues on Linux - CentOS + Hudson
                  dguebel Level 1

                  what is really weird though, is the fact that, if I do vncviewer :99 once the build process started, I can see the standalone flash player opening up and running the unit tests just fine. but it still seems like there is not communication back from that movie to hudson to kill vncserver, write the report and keep going...

                  • 6. Re: CI issues on Linux - CentOS + Hudson
                    legrosb Level 3

                    @dguebel - Is the stand alone Flash Player closing or staying open once the test run is complete?  If the problem is the Xvnc process not being killed, that is not maintained by the FlexUnit Ant task.  The Xvnc session is regulated by the Hudson Xvnc plugin, it's possible the vnc process isn't being killed because your attached to it, maybe?  From your previous posts it seems as if communication between the movie and the Ant task is not occurring correctly, which leads me to believe there is an external factor involved, I'm just not sure what.  FWIW - I was able to confirm that the Flex Ant task was working on Ubuntu 9.10 this weekend using Xvnc as well.  Are your tests being done as the same user that Tomcat/Hudson is running as?  Maybe there are differences between the two users?

                     

                    Still grabbing at straws, sorry.

                     

                    -Brian

                    • 7. Re: CI issues on Linux - CentOS + Hudson
                      Emile.Swain

                      Hi All,

                       

                      I have exactly the same issue and i believe its to do with the Flash player instance failing to connect through the socket connection due to the flash players security permissions.

                       

                      I've concluded this because when i cancled the build as you did i noticed this error in the console output.

                       

                      java.util.concurrent.ExecutionException: command [<policy-file-request/>] not understood


                      Google led me to this post that discussed issues with policy file request.

                       

                      http://osflash.org/pipermail/fvnc_osflash.org/2006-October/000005.html

                       

                      I'm still looking into this as the possible issue (for me at least), i'll let you know if i find a solution.

                       

                      Cheers

                      E.

                       

                      Message was edited by: emilejs  More discussion here  http://forums.adobe.com/thread/492971?tstart=0

                      • 8. Re: CI issues on Linux - CentOS + Hudson
                        legrosb Level 3

                        @emilejs - When the value of the localTrust attribute on the Ant task is set to false, the Ant task will try to send a socket policy XML fragment to the requesting Flash Player to show it that it's allowed to connect.  When localTrust is set to true, the Ant task will create a flexUnit.cfg trust file in the appropriate FlashPlayer folder, so that the Flash Player won't ask the Ant task if it's ok to connect, it will just trust that it is because of the file contents.  The default in Beta2 and RC1 I believe is set to false which may cause this issue.  In the next release the localTrust property on the Ant task has been defaulted to true, so this should prevent the issue many are having.  Basically the localTrust flag's goal is to help resolve the type of security sandbox the Flash Player should use when running your SWF.  The article you link to is a bit out of date with respect to the Flash Player's latest security info for socket based connections.  If you'd like more details on security sandboxes and managing security for socket-based connections, you can check out:

                         

                           http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html

                           http://livedocs.adobe.com/flex/3/html/help.html?content=05B_Security_04.html

                         

                        Here is a copy of the default response we send when locatTrusted is set to false:

                         

                        <?xml version="1.0"?>
                        <cross-domain-policy xmlns="http://localhost" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.adobe.com/xml/schemas PolicyFileSocket.xsd">
                           <allow-access-from domain=\"*\" to-ports="1024" />
                        </cross-domain-policy>

                        Another thing worth mentioning if you have localTrusted set to true, make sure that the your FlashPlayer's local trust directory has read/write permissions setup for the user running the Ant script process.  Ideally you will see a failure in the execution of the Ant script, but if you don't see the script halted and don't see the file created after the script run, this may be a bug we need to address.  I believe this is the one thing I forgot to mention to @dguebel which may be causing his problem.
                        • 9. Re: CI issues on Linux - CentOS + Hudson
                          legrosb Level 3

                          @dguebel - I just posted about this, but can you check and verify that when localTrusted is set to true, that the file /root/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg is being created?  Can you also verify that /root exists?  I'm not terribly familar with root as a user, but the Flash Player requires the trust file to be in that user's home folder or in a global location at /etc/adobe/FlashPlayerTrust.  If you're running as root on your machine, try changing the script to run as a user with a home folder, or manually move the flexUnit.cfg file that is created by the process to the global location.  I think this will fix your issue.

                           

                          If it does, please let me know so I can update the wiki for others to avoid the issue.  Thanks.

                           

                          -Brian

                          • 10. Re: CI issues on Linux - CentOS + Hudson
                            Emile.Swain Level 1

                            Hi,

                             

                            Looks like my previous edit didn't come through.

                             

                            Anyways. To get it working originally i set localTrusted to false. This appeared to work for me.

                             

                            Following your responses i tried localTrusted to true and it failed again. I then copied the flexUnit.cfg file (that flash/hudson created) to the global location and it worked with localTrusted = true.

                             

                            I don't believe the global adobe location will be updated when new builds are created so i'll be seeing if a symbolic link to the global location will work. Though if there is a way to default to the global location then i'd like to know how to do that.

                             

                            I don't know what versions of the flex unit libraries i'm using, another developer provided them, so i could be using old instances.

                             

                            Cheers

                            E.

                            • 11. Re: CI issues on Linux - CentOS + Hudson
                              legrosb Level 3

                              @emilejs - Can you show me a dump of the flexunit Ant task output when running your Ant build with the verbose property set on the FlexUnit Ant task?  If Java isn't reporting the user's home directory correctly on CentOS, this is a bug we need to account for, so we may switch the trust file being written to a global location for Linux rather than the user's home directory.  Are you running as root user as well?  Glad to hear you found a workaround, hopefully we can get a more viable solution working for you.

                               

                              -Brian

                              • 12. Re: CI issues on Linux - CentOS + Hudson
                                Emile.Swain Level 1
                                perform-compile:
                                    [mxmlc] Loading configuration file /usr/local/flex-sdk/3.2.0/frameworks/flex-config.xml
                                    [mxmlc] /root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp/Tests.swf (949468 bytes)

                                perform-unit.tests:
                                [flexunit] Validating task attributes ...
                                [flexunit] Generating default values ...
                                [flexunit] Using default snapshot file path [/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp/snapshot.jpg]
                                [flexunit] Using the following settings:
                                [flexunit]      haltonfailure: [false]
                                [flexunit]      headless: [false]
                                [flexunit]      localTrusted: [true]
                                [flexunit]      player: [flash]
                                [flexunit]      port: [6000]
                                [flexunit]      snapshot: [false]
                                [flexunit]      snapshotFile: [/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp/snapshot.jpg]
                                [flexunit]      swf: [/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp/Tests.swf]
                                [flexunit]      timeout: [24000ms]
                                [flexunit]      toDir: [/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp]
                                [flexunit]      verbose: [true]
                                [flexunit]      xcommand: [xvfb]
                                [flexunit] Setting up server process ...
                                [flexunit] OS: [Unix]
                                [flexunit] Starting server ...
                                [flexunit] Opening server socket on port [6000].
                                [flexunit] Waiting for client connection ...
                                [flexunit] Launching player:
                                [flexunit] Executing 'gflashplayer' with arguments:
                                [flexunit] '/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp/Tests.swf'
                                [flexunit]
                                [flexunit] The ' characters around the executable and arguments are
                                [flexunit] not part of the command.
                                [flexunit]
                                [flexunit] Created local trust file at [/root/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg]
                                [flexunit] Client connected.
                                [flexunit] Setting inbound buffer size to [262144] bytes.
                                [flexunit] Receiving data ...
                                [flexunit] Sending acknowledgement to player to start sending test data ...

                                ...
                                Loads of unit tests are output...
                                ...
                                [flexunit]
                                [flexunit] Stopping server ...
                                [flexunit] End of test data reached, sending acknowledgement to player ...
                                [flexunit] Closing client connection ...
                                [flexunit] Closing server on port [6000] ...
                                [flexunit] <endOfTestRun/>
                                [flexunit] Analyzing reports ...

                                ...
                                Analysis output
                                ..

                                BUILD SUCCESSFUL
                                Total time: 8 seconds
                                Terminating xvnc.
                                [workspace] $ /usr/bin/vncserver -kill :99
                                Killing Xvnc process ID 6182
                                Recording test results

                                Finished: SUCCESS


                                When i encounted the original issue with the build hanging i would have to manually kill the build. the following is the output
                                perform-unit.tests:
                                [flexunit] Validating task attributes ...
                                [flexunit] Generating default values ...
                                [flexunit] Using default snapshot file path [/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp/snapshot.jpg]
                                [flexunit] Using the following settings:
                                [flexunit]      haltonfailure: [false]
                                [flexunit]      headless: [false]
                                [flexunit]      localTrusted: [true]
                                [flexunit]      player: [flash]
                                [flexunit]      port: [6000]
                                [flexunit]      snapshot: [false]
                                [flexunit]      snapshotFile: [/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp/snapshot.jpg]
                                [flexunit]      swf: [/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp/Tests.swf]
                                [flexunit]      timeout: [24000ms]
                                [flexunit]      toDir: [/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp]
                                [flexunit]      verbose: [true]
                                [flexunit]      xcommand: [xvfb]
                                [flexunit] Setting up server process ...
                                [flexunit] OS: [Unix]
                                [flexunit] Starting server ...
                                [flexunit] Opening server socket on port [6000].
                                [flexunit] Waiting for client connection ...
                                [flexunit] Launching player:
                                [flexunit] Executing 'gflashplayer' with arguments:
                                [flexunit] '/root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/temp/Tests.swf'
                                [flexunit]
                                [flexunit] The ' characters around the executable and arguments are
                                [flexunit] not part of the command.
                                [flexunit]
                                [flexunit] Created local trust file at [/root/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg]
                                [flexunit] Client connected.
                                [flexunit] Setting inbound buffer size to [262144] bytes.
                                [flexunit] Receiving data ...
                                [flexunit] Sending acknowledgement to player to start sending test data ...
                                [flexunit]
                                [flexunit]
                                [flexunit] Stopping server ...
                                [flexunit] End of test data reached, sending acknowledgement to player ...
                                [flexunit] Closing client connection ...
                                [flexunit] Closing server on port [6000] ...

                                ... At this point it has hung the build and i have to manually kill it.
                                .. below is the build terminated output
                                BUILD FAILED
                                /root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/build_bin.xml:22: The following error occurred while executing this line:

                                /root/.hudson/jobs/akqa_sdk_loading/workspace/source/build/build_bin.xml:72: java.util.concurrent.ExecutionException: command [<policy-file-request/>] not understood



                                • 13. Re: CI issues on Linux - CentOS + Hudson
                                  legrosb Level 3

                                  @emilejs - Yep looks like you're having the same issue as Diego.  Try running your ant script process as a user with a home folder to see if that addresses the issue when using localTrusted=True.  I think we may want to add a feature where localTrusted is not true/false, but rather none, user, global, defaulting to local.  Local would be adding the trust file to the user's home directory, none will be the equivalent of not using the trusted sandbox, and global will add the trust file to the global trust location.

                                   

                                  Would this be helpful to anyone?  Looks like we have a use case right here.

                                   

                                  -Brian

                                  • 14. Re: CI issues on Linux - CentOS + Hudson
                                    Emile.Swain Level 1

                                    i'll try this when i set up the next project and will let you know.

                                     

                                    I find it odd that even though the flexUnit.cfg file is created, that it appears the flash player doesn't read it? Is this a linux flash player distribution issue?

                                     

                                    Admittedly i've never heard of the adobe global folder before. It strikes me that the solution would be to leave the local trusted parameter and resolve the issue as to why the flash player doesn't read the users flexunit.cfg file?

                                     

                                    the ant is executed as root and the environments setting has HOME=/root set which would suggest that this is where the flexUnit.cfg file would be read from by the player? Unless there is a seperate env variable that needs to be set or perhaps a setting in the mm.cfg file? (which it appears doens't create log files for? where would i find these?)

                                     

                                    Cheers

                                    E

                                    • 15. Re: CI issues on Linux - CentOS + Hudson
                                      legrosb Level 3

                                      @emilejs - My guess is that the value of the Java system property user. home that we use in the Ant task, doesn't match the environment variable HOME for the root user if that's what the Flash Player checks when it runs.  I'd assume if no HOME env variable is found, the FP defaults to the global trust file location which seems to be what's happening.  I'm not sure where this is documented unfortunately, so if you do find something, please let me know.  I'd assume this behavior is default regardless of platform, but again I'm not sure.

                                       

                                      Maybe a more elegant solution would be to use the HOME environment variable instead of the Java System property when running on Linux.  If HOME is not available or empty, we default to the global location.  What do you think?

                                       

                                      - Brian

                                      • 16. Re: CI issues on Linux - CentOS + Hudson
                                        dguebel Level 1

                                        Hi Brian,

                                         

                                        I've copied /root/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg to /etc/adobe/FlashPlayerTrust/flexUnit.cfg and worked like a charm! thanks heaps for that!

                                         

                                        This should be documented or better handled though...

                                         

                                        Thanks again for your help and support.

                                         

                                        Diego

                                        • 17. Re: CI issues on Linux - CentOS + Hudson
                                          legrosb Level 3

                                          @dguebel - Haha, yes, I totally agree.  I just found out most of this information today, so I'll be adding it to the wiki on flexunit.org.  I'm also going to be adding a fall back in the Ant task so that if the user's home folder can't be found, then the flexUnit.cfg file will be written to the global location.  Glad to hear all is working, hopefully we can have a fix for you guys soon.

                                           

                                          -Brian

                                          • 18. Re: CI issues on Linux - CentOS + Hudson
                                            dguebel Level 1

                                            Hi Brian,

                                             

                                            I've got a new question though, flexUnit.cfg has the path to only one project in Hudson that is running the FlexUnit at a time, does this mean I cannot run more than one project in Hudson in parallel?

                                             

                                            I found that if I run two projects in parallel at the same time the first one locked the flexUnit.cfg file with its path in it, hence the second fails.

                                             

                                            Any thoughts?

                                             

                                            * I also created a symbolic link at /etc/adobe/FlashPlayerTrust to /root/.macromedia/Flash_Player/#Security/FlashPlayerTrust

                                             

                                            Cheers,

                                            Diego

                                            • 19. Re: CI issues on Linux - CentOS + Hudson
                                              legrosb Level 3

                                              @dguebel - This is a good question.  Ideally I guess I should be appending and removing entries from the flexUnit.cfg file for parallel runs.  The one thing to look out for however is executing multiple instances of the Ant task on the same port.  By default the CIListener and Ant task communicate over port 1024.  If you are running two builds in parallel and they aren't configured to work off of different ports, you may get some very strange results written out to file and possibly one or both of the executions failing, like you're seeing.  To guarantee each build isn't stepping on the others "feet", you will want to tokenize your test SWF compilation as well as the call to the flexunit Ant task to use a particular port based on the build.  Based on how agressive your build schedule is, you may want to consider either having a single executor for the Hudson instance, or a specific Hudson slave with a single executor just for Flex builds.  If your schedule is aggressive, then definitely give the port tokenization idea a shot.  If you can file a bug for the flexUnit.cfg file locking issue, I'll make sure to tackle it with the other fix we've identified today.

                                               

                                              As far as the symlink idea goes, although this works now, after my fix goes into place, this file will be written to the global location when running as the root user on Linux, so you shouldn't need to work around.  I'll let you know when it's in place.

                                               

                                              Thanks again for all the great feedback.

                                               

                                              -Brian

                                              • 20. Re: CI issues on Linux - CentOS + Hudson
                                                neypalm

                                                I'm having the same problems on Windows Server 2008:


                                                If I set localTrusted="true" the test task fails with "java.util.concurrent.ExecutionException: command [<policy-file-request/>] not understood" on Windows Server 2008, but works on Windows XP.

                                                If I set localTrusted="false" the tests work on Windows Server 2008, but hangs on Windows XP.

                                                 

                                                I'm using the flexUnitTasks.jar from the FlexUnit 4 RC2 build, and the flexTasks.jar from the 13875 release of the Flex SDK.

                                                • 21. Re: CI issues on Linux - CentOS + Hudson
                                                  legrosb Level 3

                                                  @neypalm - This is occurring because the localTrust file is not being written to the correct location for Windows Server 2008 so that the FP can use it.  Have you tried setting localTrust to false?  Unless you need to load local resources in your tests, localTrust=false should work as a stop gap.  We currently have an inquiry into Adobe and are trying to get a list of all locations (local and global) that are used by the Flash Player on all supported platforms so we can update the Ant task to work in tandem with the FP.

                                                   

                                                  If anyone can help update/correct the below list in the meantime, I'd be really thankful for the help.  Here's what I have thus far:

                                                   

                                                  - Windows XP, Windows Server 2000, Windows Server 2K3

                                                     - User - <appdata env variable>\Roaming\Macromedia\Flash Player\#Security\FlashPlayerTrust

                                                     - Global - <system env variable>\Macromed\Flash\FlashPlayerTrust

                                                   

                                                  - Windows Vista/7 32-bit, Windows Server 2008 32-bit

                                                     - User - <appdata env variable>\Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust

                                                     - Global - <system folder env variable>\Macromed\Flash\FlashPlayerTrust

                                                   

                                                  - Windows Vista/7 64-bit, Windows Server 2008 64-bit

                                                     - User -?

                                                     - Global -?

                                                   

                                                  - MacOS

                                                     - User - <home env variable>/Library/Preferences/Macromedia/Flash Player/#Security/FlashPlayerTrust

                                                     - Global - <appdata env variable>/Macromedia/FlashPlayerTrust

                                                   

                                                  - Linux (various 32-bit flavors)

                                                     - User - <home env variable>/.macromedia/Flash_Player/#Security/FlashPlayerTrust

                                                     - Global - /etc/adobe/FlashPlayerTrust

                                                   

                                                  I hope to have these fixes in soon.  I'll let you know when they're done so you can beta test for me.  Worse case you could manually copy the flexUnit.cfg file into the global location for Windows 2008.  I'll keep you updated.

                                                   

                                                  -Brian

                                                  • 22. Re: CI issues on Linux - CentOS + Hudson
                                                    neypalm Level 1

                                                    Thanks for the info, Brian. I'm currently satisfied with having localTrusted="false", so that the ant task works on the build server. We can run tests through Flash Builder locally.

                                                     

                                                    Just let me know when you get locations back from Adobe, and I'll test Windows Server 2008 64 bit for you! As you indicate with your question mark for 64 bit, it does not help with flexUnit.cfg in C:\Windows\system32\Macromed\Flash\FlashPlayerTrust.

                                                    • 23. Re: CI issues on Linux - CentOS + Hudson
                                                      mech-head Level 1

                                                      Hey there,

                                                       

                                                      we're running into exactly the same kind of trouble on windows server 2008 64-bit. I've tried locating the FlashPlayerTrust directory on the file system but it seems non-existent.

                                                      The only path I can find is this:

                                                      C:\Users\<UserName>\AppData\Roaming\Macromedia\FlashPlayer

                                                       

                                                      On my local machine (windows 7 64-bit) this path exists as well but also contains this subdirectory: #Security/FlashPlayerTrust and this is where the flexunit.cfg file ends up being written. So it works like a charm locally on windows 7 64-bit, but fails completely on windows server 2008 64-bit. Even if we manually create the #Security/FlashPlayerTrust directory and copy the flexunit.cfg file there.

                                                       

                                                      So, no solution here, but I hope the extra information can be useful to someone.

                                                       

                                                      cheers,

                                                       

                                                      Roland

                                                      • 24. Re: CI issues on Linux - CentOS + Hudson
                                                        mech-head Level 1

                                                        Ok, found it, on WIndows Server 2008 64-bits the FlashPlayer uses this directory for its trust files:

                                                         

                                                        C:\Windows\SysWOW64\Macromed\Flash\FlashPlayerTrust

                                                         

                                                        manually copying the flexunit.cfg file there will solve the errors. (At least for us it did)

                                                         

                                                        hope this helps somebody,

                                                         

                                                        cheers,

                                                         

                                                        Roland

                                                        • 25. Re: CI issues on Linux - CentOS + Hudson
                                                          legrosb Level 3

                                                          @Roland - You kick *** man.  I've been searching for this since the request for it had come on the thread.  I love the fact that it's called SysWOW64; I had to look it up, but I guess that it means System for Windows on Windows 64 (i.e. - 32-bit) ... awesome.  I don't have a VM to confirm the use case, but I'll do some research on how to identify Windows Server 2008 and make sure this path is used.  I'll let the forums know when I have a patch available.  Thanks again man!

                                                           

                                                          -Brian

                                                          • 26. Re: CI issues on Linux - CentOS + Hudson
                                                            mech-head Level 1

                                                            Well, actually my colleage found it out, so I'll pass on the asskicking compliment to him.

                                                            Just for completion sake, as far as we can see this is the user path on win server 2008 64-bit:

                                                             

                                                            C:\Windows\System32\config\systemprofile\AppData\Roaming\Macromedia\Flash PLayer\#Security\FlashPLayerTrust

                                                             

                                                            and thanks for flexunit tasks, they are incredibly useful, great work!

                                                             

                                                            cheers,

                                                             

                                                            Roland

                                                            • 27. Re: CI issues on Linux - CentOS + Hudson
                                                              legrosb Level 3

                                                              @Roland - Awesome, thanks for the additional info, it'll be really helpful to have this as well.  I will shoot to have a fix ready in my fork on github tonight to put this bug to bed.  Thanks again to you and your colleague for the help.

                                                               

                                                              -Brian

                                                              • 28. Re: CI issues on Linux - CentOS + Hudson
                                                                legrosb Level 3

                                                                @Roland - Since you have access to a Windows 2008 server, can you check the value of the OS environment variable

                                                                for me?

                                                                 

                                                                echo %OS%

                                                                 

                                                                From what I've seen, Windows 2008 Server likes to indentify itself just as Windows 7 does to Java (Windows 6.1), so I'm going to have to look to the environment variable for some clues.  If you know of any other environment variables that may help, please pass them along.  Any help is appreciated.  Thanks.

                                                                 

                                                                -Brian

                                                                • 29. Re: CI issues on Linux - CentOS + Hudson
                                                                  mech-head Level 1

                                                                  @Brian, sorry for the delay, but the easter weekend came in between a little

                                                                   

                                                                  I'm afraid I probably don't have satisfactory news for you either, this is the result of 'echo %OS%' on windows server 2008:

                                                                   

                                                                  Windows_NT


                                                                  I hope this helps you along a little further, perhaps you should try stackoverflow.com for any further advice? I'm sure there's people on there that can help out.

                                                                   

                                                                  good luck and let me know if I can test anything else for you,

                                                                   

                                                                  cheers,

                                                                   

                                                                  Roland