Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--fail-fast dont work on multhread execution #895

Open
T00595 opened this issue Mar 10, 2023 · 12 comments
Open

--fail-fast dont work on multhread execution #895

T00595 opened this issue Mar 10, 2023 · 12 comments

Comments

@T00595
Copy link

T00595 commented Mar 10, 2023

Hello everything is fine? I have a very specific problem with the gem, here in our project we run the automation in parallel on a farm of devices, we try to apply the fail fast command but when we run it like this, the command does not generate the cucumber report since it just kills the threads but does not generate the final report, why do we want that? We have the smoke tests and we need it to stop running when it finds the first failure to save time for the next run.

here the command used:
execute_command logger "bundle exec parallel_cucumber #{load_features_path_from_file(args)} -n #{number_of_devices(args)} --group-by scenarios --first-is-1 --fail-fast "

here it interrupts the threads but does not generate the cucumber report:
image

@grosser
Copy link
Owner

grosser commented Mar 10, 2023

that might be fixable by making the other processes finalize the report on_exit / when Interrupt-ed
PR welcome, maybe start by making a failing test case

@T00595
Copy link
Author

T00595 commented Mar 10, 2023

But we assemble the report in at_exit, but what happens is that when the threads are interrupted the json files not exist fro him to assemble the final report, he simply stops the execution

@T00595
Copy link
Author

T00595 commented Mar 10, 2023

at_exit do finish_labmobile_execution if SESSION_TYPE.eql?('continuous') && TEST_LOCATION.eql?('labmobile') if ENV.fetch('TEST_ENV_NUMBER', nil) && ParallelTests.first_process? ParallelTests.wait_for_other_processes_to_finish options = { report_path: File.join('reports', "features_report_#{PLATFORM}") } ReportBuilder.build_report ReportBuilder.options.merge(options) end end

@grosser
Copy link
Owner

grosser commented Mar 11, 2023

each worker also has to dump their report at_exit to make this work ?

@T00595
Copy link
Author

T00595 commented Mar 13, 2023

each worker also has to dump their report at_exit to make this work ?

in this case yes, because they are independent executions and at the end it groups all the reports

@T00595
Copy link
Author

T00595 commented Mar 27, 2023

any news?

@grosser
Copy link
Owner

grosser commented Mar 28, 2023

idk this is complicated 😞
... can you make a simple example repo that shows the problem ?
would help verifying any fix that we come up with and allow me to play with the setup you are running

@T00595
Copy link
Author

T00595 commented Mar 30, 2023

idk this is complicated 😞 ... can you make a simple example repo that shows the problem ? would help verifying any fix that we come up with and allow me to play with the setup you are running

ok, let's try to reproduce our project without exposing our data, as soon as we have it we will attach it here

@grosser
Copy link
Owner

grosser commented Mar 30, 2023 via email

@ramosjuliano
Copy link

@grosser As per the above conversation, here is a structure similar to ours. It has a basic test, but it shows the same error as ours.

https://github.com/ramosjuliano/automation-app

@grosser
Copy link
Owner

grosser commented Jun 17, 2023

Error Message:
  Oracle instant client is not found.
  You need to install Oracle instant client.

and when I remove ruby-oci8 I get

NO VIRTUAL DEVICES FOUND, MAKE SURE YOU HAVE SOME VIRTUAL DEVICE CREATED!

when I meant was an example that has 2-4 tests that all sleep for example and then 1 of them fails
no gems except parallel_tests + cucumber and especially no databases :)

@T00595
Copy link
Author

T00595 commented Jun 19, 2023

Error Message:
  Oracle instant client is not found.
  You need to install Oracle instant client.

and when I remove ruby-oci8 I get

NO VIRTUAL DEVICES FOUND, MAKE SURE YOU HAVE SOME VIRTUAL DEVICE CREATED!

when I meant was an example that has 2-4 tests that all sleep for example and then 1 of them fails no gems except parallel_tests + cucumber and especially no databases :)

about the devices, you need to have android studio installed on your machine together with the appium, create a device in the android studio nexus 5x, after that start the appium and run the automation code so you won't have this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants