mgivney / easyb

Automatically exported from code.google.com/p/easyb
0 stars 0 forks source link

Parallel tests return from Ant task upon first failure #218

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create test suite with several long-running tests and one quickly failing 
test
2. Run tests with parallel="true" from Ant
3. All tests are not executed

What is the expected output? What do you see instead?

Expect all tests to be run.

What version of the product are you using? On what operating system?

0.9.8.2 on Mac OS X, tests are using Selenium framework.

Please provide any additional information below.

I'm using Selenium with easyb in parallel mode from Ant, and the quick failure 
is causing my browser windows to be left open on our build server. A good 
feature would be to provide an option to fail fast, but even in that case 
already started threads should be allowed to finish gracefully.

Original issue reported on code.google.com by lpiispa...@gmail.com on 26 May 2011 at 8:51

GoogleCodeExporter commented 9 years ago
Looking at the source code, I see the problem with this bit:

      for (final Behavior behavior : behaviors) {
        RunnableBehavior task = new RunnableBehavior(behavior);
        executedBehaviors.add(task);
        executor.execute(task);
      }

      executor.shutdown();
      executor.awaitTermination(60, SECONDS);

Selenium tests can easily run longer than 60 seconds, so this timeout should be 
configurable.

Original comment by lpiispa...@gmail.com on 26 May 2011 at 8:59

GoogleCodeExporter commented 9 years ago
Yep. agreed, what should the flag be?

Original comment by rich...@bluetrainsoftware.com on 26 May 2011 at 10:19

GoogleCodeExporter commented 9 years ago
Maybe "parallelTimeout" or something to that extent...?

Also, it would be very useful to be able to control the amount of parallel 
threads. Currently I'm using a custom Semaphore mechanism to limit the number 
of concurrent browser instances on our build server - it can't quite cope with 
ten simultaneous Firefox instances. This flag could be "maxThreads" or 
something?

Original comment by lpiispa...@gmail.com on 26 May 2011 at 10:39

GoogleCodeExporter commented 9 years ago
Sure. You building via maven or some other mechanism? I'm just concerned about 
writing tests for this :-)

Original comment by rich...@bluetrainsoftware.com on 27 May 2011 at 2:25

GoogleCodeExporter commented 9 years ago
please review commit. 
https://github.com/easyb/easyb-core/commit/686dbd16be137b42a6bc1a2c0109bf2922746
b2d

Original comment by richard....@gmail.com on 27 May 2011 at 5:49

GoogleCodeExporter commented 9 years ago
I added it into Ant as well.

Original comment by richard....@gmail.com on 27 May 2011 at 6:09

GoogleCodeExporter commented 9 years ago
Looks good to me! Will clone and test still.

Original comment by lpiispa...@gmail.com on 27 May 2011 at 8:25