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

Couldn't store data for global purposes while parallel running #4768

Closed
NazarYermolenko opened this issue Oct 8, 2021 · 1 comment
Closed
Labels
area: parallel mode Regarding parallel mode type: question support question

Comments

@NazarYermolenko
Copy link

Description

Case: I need to collect custom data from tests while parallel running and then I need to use that.
The way I did, I tried to store and collect data in the static object but while parallel running it creates a new static object for each worker anyway, I've tried to use setup, teardown methods, global setup/teardown methods, but still couldn't resolve the issue.

Steps to Reproduce

Create a few tests async tests (10 parallel tests) for 4 workers, and try to collect generated random numbers in each test to global object or file.

Expect:
The global tear-down setup methods can access in-memory values.
Or to have a container for data between workers

Actual:
Global teardown/setup methods don't have access to in-memory (test) values.
It's impossible to share or collect data between workers

@NazarYermolenko NazarYermolenko changed the title Couldn't store data in for global purposes while parallel running Couldn't store data for global purposes while parallel running Oct 14, 2021
@juergba juergba added type: feature enhancement proposal area: parallel mode Regarding parallel mode and removed unconfirmed-bug labels Oct 21, 2021
@malammar
Copy link

As the workers are separate child processes there's no easy way to send data back to the main process. My recommendation is to have each worker/test write to a temporary file and then read that file at the end of the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: parallel mode Regarding parallel mode type: question support question
Projects
None yet
Development

No branches or pull requests

4 participants