More FlexUnit woes (adl hangs)

Nicolas Estrada's Avatar

Nicolas Estrada

22 Mar, 2013 05:18 PM

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. 1 Posted by Nicolas Estrada on 22 Mar, 2013 05:19 PM

    Nicolas Estrada's Avatar

    Forgot to attach my files :)

  2. Support Staff 2 Posted by Maxime Cowez on 22 Mar, 2013 07:07 PM

    Maxime Cowez's Avatar

    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. Support Staff 3 Posted by Maxime Cowez on 22 Mar, 2013 07:16 PM

    Maxime Cowez's Avatar

    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. Support Staff 4 Posted by Yennick Trevels on 22 Mar, 2013 10:06 PM

    Yennick Trevels's Avatar

    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. Support Staff 5 Posted by Maxime Cowez on 23 Mar, 2013 10:57 AM

    Maxime Cowez's Avatar

    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. Support Staff 6 Posted by Yennick Trevels on 23 Mar, 2013 11:46 AM

    Yennick Trevels's Avatar

    Can you try to run this ant script and see if that also works: https://docs.google.com/open?id=0BwgTrjDn2SAhSmhkWmlQbFlXQ0k

  7. Support Staff 7 Posted by Maxime Cowez on 24 Mar, 2013 10:45 PM

    Maxime Cowez's Avatar

    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. Support Staff 8 Posted by Yennick Trevels on 25 Mar, 2013 07:15 AM

    Yennick Trevels's Avatar

    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. Support Staff 9 Posted by Maxime Cowez on 25 Mar, 2013 09:42 AM

    Maxime Cowez's Avatar

    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. Support Staff 10 Posted by Yennick Trevels on 25 Mar, 2013 10:07 AM

    Yennick Trevels's Avatar

    Indeed, it's the one in the SDK.

  11. 11 Posted by Nicolas Estrada on 25 Mar, 2013 07:24 PM

    Nicolas Estrada's Avatar

    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. Support Staff 12 Posted by Yennick Trevels on 25 Mar, 2013 08:28 PM

    Yennick Trevels's Avatar

    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. 13 Posted by Nicolas Estrada on 26 Mar, 2013 09:37 AM

    Nicolas Estrada's Avatar

    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. 14 Posted by Nicolas Estrada on 26 Mar, 2013 01:07 PM

    Nicolas Estrada's Avatar

    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. Support Staff 15 Posted by Yennick Trevels on 26 Mar, 2013 01:59 PM

    Yennick Trevels's Avatar

    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. Support Staff 16 Posted by Yennick Trevels on 28 Mar, 2013 04:46 PM

    Yennick Trevels's Avatar

    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. 17 Posted by NagRock on 11 Jul, 2013 09:27 AM

    NagRock's Avatar

    Worked for me. Thanks!

  18. 18 Posted by sorin.portase on 23 Jul, 2013 11:39 AM

    sorin.portase's Avatar

    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. 19 Posted by Szymon Bochniak on 08 Aug, 2013 07:29 PM

    Szymon Bochniak's Avatar

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

  20. Support Staff 20 Posted by Yennick Trevels on 07 Mar, 2016 09:09 AM

    Yennick Trevels's Avatar

    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

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

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

Recent Discussions

24 Jun, 2017 02:18 PM
10 Jun, 2017 04:16 PM
24 Mar, 2017 07:10 PM
19 Mar, 2017 04:39 AM
22 Jan, 2017 07:46 AM

 

11 Oct, 2016 01:18 PM
20 Sep, 2016 04:36 PM
06 Sep, 2016 08:05 PM
03 Aug, 2016 11:15 AM
01 Jun, 2016 05:20 PM
03 May, 2016 09:17 PM