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

Running Sequential task set tasks with continuous generated data #2693

Open
2 tasks done
pranesh517 opened this issue Apr 30, 2024 · 1 comment
Open
2 tasks done

Running Sequential task set tasks with continuous generated data #2693

pranesh517 opened this issue Apr 30, 2024 · 1 comment

Comments

@pranesh517
Copy link

Prerequisites

Description

Trying to run SequentialTaskSet tasks with continuously generated data but failed to get the result:

`test_run_specific_data = None
class sampleTest(SequentialTaskSet):

@task
def test1(self):
    global test_run_specific_data
    test_run_specific_data = str(random.randint(1001, 9999))
    print("test 1 " + test_run_specific_data)

@task
def test2(self):
    print("test 2 " + test_run_specific_data)

class loadTest(HttpUser):
tasks = [sampleTest]
wait_time = between(5, 10)`

I am running this test with 3 users. For test1 i am getting 3 different random integers but for test2 last generated integer from test1 is getting printed 3 times (as last assigned value is carrying forward)

Expectation:
3 random numbers generated in test1 should get carried to test2, once test2 is finished test1 should generated new 3 random values and test2 should get newly generated values.

@cyberw
Copy link
Collaborator

cyberw commented May 1, 2024

Hi!

Tasks are randomly selected, not ordered. If you want ordering use a single big task or SequentialTaskSet.

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

No branches or pull requests

2 participants