Out of memory issue with Chrome and unit tests - javascript

I have a test suite of around 800 tests in a repository.
When I run the tests locally I end up with an Aw Snap screen at some point during the tests running.
It's more or less running on the build server (running headless), but locally it breaks almost every time.
Is there any way to free up memory to make it possible to run through the tests locally again?
It's an issue that recently started to appear and we haven't changed the unit tests to something that should cause this issue so I am afraid that it has to do with a Chrome update or so.
Chrome either loses connection to the dev tools with a Render Process Gone error or DevTools was disconnected from the page.
If I run the tests in incognito it actually says it ran out of memory.
We have an index file that runs
WCT.loadSuites([arrayOfSuites]) and each unit test have their own file
with suite(), setup and tests.
We're using Polymer 3.
Thanks

Related

Can I host Cypress to a server?

So we're using Cypress + Cucumber to perform E2E UI tests. Everything is running fine, whenever I trigger the script, it shows the cypress pop-up, and I trigger a few tasks manually. Now we want our QA person to use the same prompt to test a few specific scenarios as they will. I know one way to trigger the test is during the CI/CD pipeline, but I was wondering if there's a way to host the app on some server, and a QA person can trigger a particular flow whenever they want.
So far I found cypress run --browser chrome --headed --no-exit --port 9000 command to keep the server active and run the tests when you click on it. But when I copy the URL and open it in another browser, I see an error saying that it can't run the test because the browser was not opened by cypress.
Please let me know if there's a way to achieve it.

Open Cypress browser when running from Jenkins

I created in Jenkins a freestyle project in which I wanted to run Cypress.
In the command line I used this command line:
npx cypress run --browser chrome --headed --spec "cypress/integration/examples/actions.spec.js" --config pageLoadTimeout=10000
The issue that it runs silent mode, there is no browser that is open, and perform test actions.
What should I do so that the browser appears while executing the test? Thanks in advance.
CI tools like Jenkins aren't designed to open browser.
That is why Cypress offers two ways to run it:
For local dev/debug: cypress open
For CI/automatisation : cypress run
You are using it the right way.
Interesting things for CI are screenshots and videos.
Yes, actually when you launch tests based on Cypress on CI (not only Jenkins) - you can't watch the process in debug mode.
Only on the local machine with the open parameter.
Also, save the video OR screenshots of running tests from Jenkins - and look after

Intern test case execution hangs forever after importing snapsvg-cjs in ts file

After importing snapsvg-cjs in .ts file(in Dojo2 Project) intern test case got stuck after executing all test cases.
Any idea what I am doing wrong?
When Intern is stuck open after test cases have finished, it typically means that a file or socket is still open. Intern is done, but the Node process won't shut down while handles are still open. This can happen if, say, an asynchronous process were started in a test without returning a Promise.
One way to diagnose what's preventing the Intern process from exiting is to run it with wtfnode. When wtfnode is used to run a node program and the program is manually killed (like with with ctrl-c), wftnode will display any open resources. Run Intern with wtfnode, ctrl-c when it appears to be hung, then see what's still open.

Node grunt-contrib-connect server only works in Mac safe mode

I'm running a local dev server using grunt-contrib-connect and the server has become increasingly slow at loading assets and sometimes stalls out completely. I'm working collabaritively on this project via a shared repo and none of my other teammates have this problem. I've recloned the repo and started from scratch a few times, as well as uninstalling Node and reinstalling via NVM and another time from downloading the package on the Node website. The only solution I've found is booting my Mac running Mavericks in safe mode and then my connect server runs fine. Unfortunately most of my other applicatioms, such as my text editor, work poorly in safe mode. I'm curious what it could be about safe mode that is 'solving' this problem and if this is a hardware/software problem I should address with Apple. I'm currently running Node 0.10.30 via NVM.
Sounds like there might be some other processes running on your machine that could be causing a problem.
Maybe try opening Activity Monitor, sorting processes by CPU time and seeing what's at the top?

Failing to debug with node-inspector - what is wrong?

I have a javascript code that checks whether a point is inside a polygon. I am trying to debug it with node-inspector, following these steps:
In the first window:
PS Z:\dev> node-inspector.cmd
info - socket.io started
visit http://0.0.0.0:8080/debug?port=5858 to start debugging
In the second window:
PS Z:\dev\poc\SDR> node --debug-brk .\IsPointInside.js
debugger listening on port 5858
Now I navigate to http://localhost:8080/debug?port=5858 in my Chrome browser.
What happens is that Chrome gets stuck waiting for localhost presenting me the empty screen.
I must add that I have successfully debugged the r.js javascript optimizer using the same steps before, but now I cannot debug it as well.
according to this there seems to be an order in which the components should be started.
Its application -> debugger -> web browser.
Could be your issue.
You can also send a "debug on demand" command. Use this command:
kill -USR1 $PROCESSID

Categories