AWS Cognito create user at setup, perform test in the main scenario

#1

Hello everyone,

I am new on load testing and I am struggling with an issue.

I am trying to implement a user creation on the setup method with K6, around 100 users.

After that, in the main scenario, I want them to login in. The problem here is that, when I try to require the appropriate modules (like aws-sdk etc.) problems like regeneratorRuntime appear or it says that my file(aws-sdk) could not be found on the disk and it tries to fetch it from the web.

Is there any good practice on how to achieve what I want? Any code snippet?

Thank you in advance!

0 Likes

#2

Hi,

I suppose you just need the signature part???
So maybe trying this will help you.

Aws-sdk is quite big and k6 will need to have a copy of it for each VU as it runs completely separate VM for each of them. So preferably you should try to use … smaller amounts of js code :wink:

0 Likes

#3

Hello,

Thank you for the quick response.

I do not need just the signature, but I need the whole aws-sdk which will retrieve first the userPoolId and then create user by adminCreateUser method of AWSCognito.

Any ideas about that?

Thanks in advance.

0 Likes

#4

I played a little bit with browserify and apparently it somewhat works with the latest version v2.431.0 if I browserify ./lib/aws.js directly and then import it.

Depending on what I call I get … errors which probably can be fixed, but I get different errors depending on what I call so I probably can’t fix all of them … at least not fast enough.
Can you link me your script and maybe the aws.js you are running - possibly uploading them to a github repo and I will see how many errors I can fix. You can also try to require https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime in the aws.js file (you will have to edit it sorry) but I don’t know how much that will help.
This might resolve itself by updating babel in k6 but I am not certain how long this will take me :frowning:
Again even this js file is nearly 7mb … given that we need a copy of it in each VU and it needs to be a compiled copy I have no idea how much memory per VU will this take but my fast test says something like 10-12mb per VU just for script that loads it and prints a line not actually doing anything useful

0 Likes