2

I am starting with K6, and I have created my first test scenario.

The first thing I do in the "setup" stage is to get a token, and then in the test code, I use that token to perform operations. However, the token has an expiration of half an hour, so if the duration of my test is longer, the token is no longer valid and the test fails.

Would there be any way to rerun the "setup" step after half an hour, to get the token again? I can think of a few ways, but none seems good to me, since in cloud testing the new token would not propagate, or the duration of some iterations would be longer because of having to get a new token from another URL.

Thank you very much in advance!

  • Having long running tests is a bad smell. The longer the test, the more fragile is to be debugged and maintained. Can you split the test in smaller chunks? What is your primary goal: Are you doing load testing or e2e testing? – pjmolina Sep 01 '21 at 18:10

0 Answers0