I doing some tests that require me to collect and store individual "processing ids" from calls in K6 to our backend api's. Those id's are required to do some other tests down the line. Our backend system doesn't allow us to complete the 2 api requests after another because of the huge processing time that it takes to complete.
So TLDR: i fire an api request, get a processing id back. several hours later i can use that id to download a pdf file.
Now i need to store those id's when running the first test. Is there a simple way in k6 to have some kind of "shared mutale memory" or are there other solutions that don't involve writing thousands of individual files to store and afterwards load those ids?
There's nothing officialy built into the stable k6. There is however an experimental redis module. It allows you to read and write data from a remote Redis instance.
There's also a k6 extension, xk6-kv by one of the k6 maintainers. xk6-kv keeps the keys in memory and allows sharing state between VUs.
From your question, it sounds like the Redis-based approach would fulfill your use-case, since you need to store these keys in one k6 test run and then use them later in a different test run (which is executed in a new, distinct process).