Slow computations in mathematical AWS cognito token generation
See original GitHub issueWhat is your Test Scenario?
I’m using AWS JS Cognito API to login
What is the Current behavior?
The computation of the authentication token is taking extremely long 8 seconds when it’s over in < 1 second without testcafe. I’ve tracked down the offending function in AWS BigInteger modPow method: https://github.com/aws-amplify/amplify-js/blob/master/packages/amazon-cognito-identity-js/src/BigInteger.js#L685
What is the Expected behavior?
Testcafe execution doesn’t take a lot more time than execution without testcafe.
What is your web application and your TestCafe test code?
I’m sorry I cannot give you access to my web app currently and I haven’t reduced the problem to an example yet. It requires an AWS account or I would have to mock it for a test.
Steps to Reproduce:
Again, sorry there are no steps to reproduce yet. I’ll provide them if it turns out that this is surprising behavior that computations are much slower…
Your Environment details:
- testcafe version: 1.1.0
- node.js version: 10.15.2
- command-line arguments: testcafe -e ‘chrome’ src/testcafe -S -s screenshots -f ‘SignedIn Client Route Tests’
- browser name and version: Chrome 72.0.3626 /
- platform and version: macOs 10.14.3
- other: tests are written in Typescript (while amazon’s Cognito/BigInteger code isn’t)
Here’s a Chrome profile from a testcafe run that shows that a lot of time is spent in bnModPow
: testcafe_slow_sign-in.json.zip
And here’s a Chrome profile from a run without testcafe that is spending significantly less time overall and especially in the token generation and bnModPow
method:
without_testcafe_fast_sign-in.json.zip
Both profiles were created manually during the sign-in.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
@vsorrokin
Hello,
Thank you for the example. We’ll take it into account.
Our team need to examine the issue locally.
You need to restart the
http-playground
Gulp command after you make any changes intestcafe-hammerhead
. If you are monitoring the changes in your TestCafe test file, I suggest you follow these steps: Note: both repositories may have cross changes; that is why, you need to downgrade to the latest released version.testcafe
repository and create a branch based on the latest non-rc/alpha version, for example:v1.8.4
.testcafe-hammerhead
repository. You can find a suitable version in./package.json
of yourtestcafe
branch, for example,"testcafe-hammerhead": "16.2.3"
. Create a branch based on thev16.2.3
tag.testcafe-hammerhead
local branch to yourtestcafe
local branch.testcafe-hammerhead
local branch and run thegulp build
command.testcafe
local branch with yourtestcafe-hammerhead
changes:node bin/testcafe chrome ./some-test.js
.We’re closing this issue after a prolonged period of inactivity. If it still affects you, please create a new issue with up-to-date information. Thank you.