Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Add session keep alive #168

Closed
wants to merge 4 commits into from
Closed

Add session keep alive #168

wants to merge 4 commits into from

Conversation

bicarbon8
Copy link

Changes:

  • adds ability to call api client worker periodically with instructions to take a screenshot. this keeps the session active so test runs containing thousands of tests or long running tests will not fail due to session timeout due to inactivity
  • allows for overriding default 1 minute delay between keep alive commands to send either more frequently or less frequently
  • changes are backwards compatible and the keep alive is disabled by default

Note:

  • added benefit of periodic screenshots is that you needn't wait for the test to complete to be able to view the video and instead can check the screenshots to see test status in BrowserStack's dashboard

Jason Holt Smith added 4 commits January 15, 2020 18:08
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@bicarbon8
Copy link
Author

@googlebot I signed it!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@bicarbon8
Copy link
Author

closing this PR based on below feedback from Browserstack:

I have reviewed this internally and I would like to share that while you perform JS testing the entire test is sent as a whole to the browser and hence the screenshot command sent every 60 seconds will not stop the timer for which the browser is idle.

Hence, in order to overcome this, you would need to impose some dummy commands like printing some dummy values in the console using JavaScript only or you may execute any JS script to keep your connection alive.

Kindly give this a try and let me know how this goes.

so it seems this approach will not work and instead I'll need to change to something that outputs to the browser console

@bicarbon8 bicarbon8 closed this Jan 28, 2020
@bicarbon8
Copy link
Author

just in case anyone comes across this in the future, the solution that worked for my purposes and didn't require any code changes was to add a timeout: 1800 in the browserStack configuration object of my karma.conf.js file which keeps the session active for 30 minutes.

ex: karma.conf.js

module.exports = function(config) {
  config.set({
    browserStack: {
      username: 'your-username',
      accessKey: 'your-access-key',
      timeout: 1800
    }
    ...
  });
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants