Closed hinfaits closed 3 years ago
Having same issue here. Cypress hangs after running a single spec file when run from TeamCity but works when run manually on the same build agent. Using Cypress 3.6.0. My log files look almost identical, Cypress gets stuck on line 'cypress:server:browsers killing browser process' but works fine with Chrome. May try testing with a downgraded version of Cypress.
Having same issue. Was using 3.5.0. Downgrading to 3.3.2 works fine. Thanks
@hinfaits I see in the logs that you're passing
--env configFile=qa.json --reporter teamcity --spec .\cypress\integration\SPEC-999.js
Then
cli starts with arguments ["C:\\Program Files\\nodejs\\node.exe","C:\\BuildAgent\\work\\7f314bce6463a58b\\node_modules\\cypress\\bin\\cypress","run","--env","configFile=qa.json","--reporter","teamcity","--spec",".\\cypress\\integration\\SPEC-999.js.js"]
So this eventually looks like it's being read as:
parsed cli options {
spec: '.\\cypress\\integration\\SPEC-999.js.js',
reporter: 'teamcity',
env: 'configFile=qa.json'
}
So, I'm not sure why the SPEC-999.js.js
has a double .js
Anyway, I don't think this matters cause it seems to find the spec file to run later:
cypress:server:specs found 1 spec files: [ { name: 'SPEC-999.js', relative: 'cypress\\integration\\SPEC-999.js.js', absolute: 'C:/BuildAgent/work/7f314bce6463a58b/cypress/integration/SPEC-999.js' } ]
So I'm just making it to the end of your logfile and I actually do not see Cypress hanging. I am seeing Cypress issue an exit code of 1, since 1 test file failed, so I do not see how this is an issue with Cypress.
For the record - I'm having the same issue - except with Cypress 3.6.0
@jennifer-shehane, in the logs the double .js is likely because I was using find/replace to remove some internal data (just to be on the safe side).
In the logs where you've identified exit with code 1
, that happens after I've sent selected Stop Build from TeamCity Server and now it's killed what's running on the agent. Before that, it's hung for 6 minutes trying to close the browser.
Interesting. Do you happen to have any on beforeunload
listeners in your code as detailed in this issue? https://github.com/cypress-io/cypress/issues/2118
Does passing the --browser
flag to run in chrome
make any difference?
We don't have beforeunload listeners generally. We do have some in an area we do not touch with our Cypress based automation.
Running with chrome
solves all our hanging. Unfortunately it introduces some other problems so it isn't a viable workaround for us.
Please let me know if there's any more information you'd like to debugging I can do.
Interesting. Do you happen to have any on beforeunload listeners in your code as detailed in this issue? #2118
I have a similar issue and a very simple test suite. No beforeunload
is involved but I have a listener on window:before:load
.
Does passing the --browser flag to run in chrome make any difference?
it fixes my problem!
We have a window:before:load
which causes the process to hang, it only happens when being executed though the TeamCity agent; running against the same user locally on the box works fine. We're a paying customer so we can run parallel and this is stopping us being able to use it at present. Switching to Chrome makes the tests run significantly slower.
This is happening in vsts/azure devops as well.
Any update on this?
Unfortunately we'll have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.
Please comment in this issue with a reproducible example so we can look into the issue further.
Since this issue hasn't had activity in a while, we'll close the issue until we can confirm this is still happening. Please comment if there is new information to provide concerning the original issue and we'd be happy to reopen.
Current behavior:
This is a full log where the build hangs while running an empty test (our config includes a global hook to load the application and modify localStorage in the support file, but this test is empty). Some stuff has been redacted slightly. - https://pastebin.com/ULeiF83U
When running a normal test, it seems like things go wrong after these lines are spat out. After this there's more messages from the browser and I can see my application idling, making some requests and logging some messages but it doesn't look like any further test steps are executed. It looks like in both cases there's a drop in connectivity with the browser but they may be different issues.
Desired behavior:
Builds do not hang.
Steps to reproduce: (app code and test code)
This is happening consistently but I cannot seem to reproduce this outside of specifically launching our tests on the TeamCity agent from TeamCity Server. When using PsExec to run the tests as the system user (our TeamCity agent uses the system user) everything executes as normal.
I'm not sure how to deliver a full reproducible example as it looks like something specific to our environment. But I will try my best to help debug.
Versions
Cypress 3.5.0 Electron Windows 8 + Windows 10