Behat(3.0) parallel test fails with exit code 255

Behat(3.0) parallel test fails with exit code 255

by tulasi atikamsetti -
Number of replies: 3

Hi,

I am trying to run behat test with parallel option for the first time. When used

php admin/tool/behat/cli/init.php --parallel=4

I could successfully see 4 directories being created and all the behat.yml files has the same wd_host: 'http://localhost:4444/wd/hub'

So I manually modified them to have different ports.

But when I ran php admin/tool/behat/cli/run.php, I run into the following issue. Can someone suggest me how to fix it.behat parallel tests fail with exit code 255

Average of ratings: -
In reply to tulasi atikamsetti

Re: Behat(3.0) parallel test fails with exit code 255

by Rajesh Taneja -

Hello Tulasi,


If you want o use different selenium ports for each process then you should set the following in config and re-initialise behat.

 $CFG->behat_parallel_run = array (

    array ('wd_host' => 'http://127.0.0.1:4444/wd/hub'),

    array ('wd_host' => 'http://127.0.0.1:4445/wd/hub'),

    array ('wd_host' => 'http://127.0.0.1:4446/wd/hub'),

    array ('wd_host' => 'http://127.0.0.1:4447/wd/hub'),

);


As per exit code, it seems to be happening because of permission issue. Can you please try following manually.

  1. Create a link behatrun1 under your moodle source directory pointing to your moodle src code. 
  2. visit your site http://mymoodle/behatrun1 and ensure site is accessible, if not then you need to fix directory permissions.
  3. After fixing above ensure 4 instances of selenium are running at defined ports.
  4. Run behat via run.php 



In reply to Rajesh Taneja

Re: Behat(3.0) parallel test fails with exit code 255

by tulasi atikamsetti -

Thanks Rajesh for the response. I see that 

Acceptance tests site installed for sites:

http://127.0.0.1:8888/moodle31/behatrun1

http://127.0.0.1:8888/moodle31/behatrun2

http://127.0.0.1:8888/moodle31/behatrun3

http://127.0.0.1:8888/moodle31/behatrun4

But when I try to open those, it says The requested URL /moodle31/behatrun1 was not found on this server.

I see no extra instances are created from my code base. Can you suggest any resource link that would help me set up behat parallel using selenium. 

Appreciate your response,

Tulasi.

In reply to tulasi atikamsetti

Re: Behat(3.0) parallel test fails with exit code 255

by Rajesh Taneja -

Hello Tulasi,


Few things you need to ensure to run parallel behat:

  1. run.php create symlinks to moodle code for each run. That means /moodle31/behatrun1 points to /moodle31. If you have any permission problems then it will fail to create symlinks
  2. Befor you run parallel run ensure selenium is running on proper port, and apache server is up.

In your case:

  1. Please check if http://127.0.0.1:8888/moodle31 is accessible via browser.
  2. create a symlink for each run like: ln -s path_to_www/moodle31 path_to_www/moodle31/behatrun1
  3. Ensure http://127.0.0.1:8888/moodle31/behatrun1 is accessible via browser
  4. Now run php admin/tool/behat/cli.run.php