More FlexUnit woes (adl hangs)

Hello again,

Well as an experiment to see if I can use gradlefx for the massive Flex/AS3 project(s) I've "inherited" I decided to fork the as3corelib and try to build it with gradlefx.
My problem may be with the actual FlexUnit task, however I've confirmed that using Ant the build runs through normally however when I try using gradlefx, it is able to execute a few tests (I can see the report XML files in my build dir) however after a while the process hangs forever.

I've attached my build.gradle along with the output of my process which for some reason doesn't spew out as much info into the stdout/err as it does when I try to build with Ant.

Has anyone ever had any issues with FlexUnit that resembles this?

  1. Forgot to attach my files :)

  2. I can already confirm that the issue is related to ADL.

    What I have tried until now:

    • I added com/adobe/air/**/* to the flexUnit.excludes
    • I removed all configuration for running the tests with AIR
    • The tests ran as expected (though there was one failure)
  3. I gradually started reintegrating your original build script, and I can confirm that it runs normally. (Should've tried that in the first place, grmbl). So discard that previous comment.
    It looks like the issue is related to your build environment. Can you give us the specifics of your environment.

  4. I think this can be related to this issue: https://gradlefx.tenderapp.com/discussions/problems/57-flexunit-41-...

    To summarize, I was able to reproduce the issue with ant + flexUnit. And for some reason it didn't work on my pc, but it worked on Michael Labriola's pc. But I haven't had time to investigate this any further. The referenced thread should have my test case as attachment.

  5. If it works on one PC and not the other, I guess it should be environment-related.

    It works on mine with:

    • Windows 7 32-bit
    • Java 1.7.0_02 32-bit
    • Groovy 1.8.6
    • Ivy 2.2.0
    • ANT 1.8.4
    • Gradle 1.4
    • GradleFx 0.6.4
    • Flex 4.6
    • FlexUnit 4.1.0-8 (latest binary version)
  6. Can you try to run this ant script and see if that also works: https://docs.google.com/open?id=0BwgTrjDn2SAhSmhkWmlQbFlXQ0k

  7. Yes, it runs: with one failing test as a result.

    Did this one with standalone ANT 1.9.0

    I'll try to have a colleague with a 64-bit Win run this tomorrow.

  8. My ant script also works on my work pc:

    • Windows 7 64-bit
    • Java jdk1.7.0_11 64-bit
    • ANT 1.8.4
    • Flex 4.6
    • FlexUnit 4.1.0-8-flex_4.1.0.16076

    But it doesn't work on my pc at home.

  9. Damn! My money was on a 64-bit issue.
    The adl used is the one that comes with the SDK, right? So those should be the same as long as you use the same SDK.

  10. Indeed, it's the one in the SDK.

  11. Well FYI this is my environment:

    1. Windows 7 x64 (and Cygwin)
    2. Java jdk1.7.0_13 64-bit
    3. Gradle 1.4 (and the ant & groovy version which come with it)
    4. GradleFx 0.6.4
    5. FlexUnit 4.1.0-8 (latest binary version)
    6. Ant 1.8.4

    Now I've noticed a couple of odd things, and being new to Flex (but not new to gradle) maybe you can shed some light:
    1. Now I'm able to run the ant test target, and all but 1 test fail, however adl.exe hangs after running the test suite (perhaps related to the bug above)
    2. Using the same FLEX_HOME and the same FLEXUNIT_LIBS (I modified the build.xml) using gradlefx I can see in the reports dir that some tests are generated (presence of XML report files) however half aren't.
    3. Is it normal that I can't see any stdout/err when running using gradlefx? Is it possible that not capturing the ant task output is what is preventing adl from running properly?

    I would be glad to try out someone's build.gradle so that I can see if the problem is indeed purely environment related, although if ant works I don't see why gradlefx wouldn't. The only thing I can think of is that gradlefx generates a TestRunner.swf and the ant builds one based on an mxml file (CoreLibTestRunner in this specific case)

    Thanks for any help! :)

  12. Hi Nicolas,

    Can you also try this ant script: https://docs.google.com/open?id=0BwgTrjDn2SAhSmhkWmlQbFlXQ0k

    You have to set the FLEX_HOME variable in the script and then you can run it by just executing the "ant" command.

    Thanks

  13. Works like a charm. ADL is able to execute the test, and it quits normally. I ran this under cygwin on my Win7 x64 machine. I've attached the output in case it helps at all.

  14. Thank you Yennick!
    Your little project helped me figure out what I needed to do! So I began importing all of the .as files as well as the test .as files into your little flexunit ANT project and after some tests ADL was hanging again.

    So I looked around at this site : Configuring the debugger version of Flash Player

    and after creating the file mm.cfg in C:/Users/nestrada containing :

    ErrorReportingEnable=1
    MaxWarnings=500
    TraceOutputFileEnable=1
    

    It works! I was able to compile and TEST with gradlefx :) Perhaps you can note this in the documentation if it is not already there ;)

  15. Awesome! This brings us one step further in the process of solving this. While editing the mm.cfg file is a reasonable temporary solution, it is not ideal when you want to share your project with others.

    I'll try this out on my pc at home tomorrow and see if it's also solved there with the mm.cfg config.

    Thanks for investigating this further!

  16. For some reason I can't reproduce the problem anymore on any of my pc's with the ant script, while it has been failing in the past. Must be witchcraft...

  17. Worked for me. Thanks!

  18. Actually only the ErrorReportingEnable=1 setting is required.
    I have also noticed that FlashDevelop magically creates the mm.cfg file with the ErrorReportingEnable=1 setting.

  19. Thanks for the solution. Adding the mm.cfg helped me as well!

  20. I think I've found the actual cause of this issue and documented the troubleshooting process and solution in the GradleFx documentation: http://doc.gradlefx.org/en/latest/flexunit.html#my-unit-tests-hang-...

Reply to this discussion Internal reply only staff will see it

Markdown

Attaching KB article:

» »

Read more…

Attach files

Up to 10MB each.

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac