The situation is next: I need to run the performance tests using jmeter. I have setup several Graphql requests, tested them and they work perfectly. The idea of the flow is next:
- The user login to the platform using graphql mutation, and in response headers receives accessToken, which is valid for an hour.
- The next graphql request must parce the generated token, and perform the next mutation using this token.
- The idea is to test the platform with 250k requests, which takes more than 1 hour, and as you probably understand - the token is expired.
What I have done within my script:
- I've created 2 thread groups. In the first, there is a Flow is Control action element, which is setup to pause duration for 3600000 msec. This means that it will run the Login request once per hour.
- I'm scraping the token with JSON extractor, and parcing it using the BeanShell post-processor, by the following command:
props.put("accessToken", vars.get("accessToken"));
- Second thread group has a Graphql request to perform the 250k requests to the server and uses the token value from HTTP headers:
Bearer ${__P(accessToken)}
Everything works fine, accept the fact, that I don't know how to setup the scenario, where the thread group with login will finish its run, after the second thread group will complete 250k requests. I've tried adding the loop controller to Login, set as infinite, but the thing that once the second group will complete 250k requests - the run won't be finished, as the Login will be running forever once per hour.
Any ideas?