-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Delaying execution, these browsers are not ready" Error #411
Comments
What version of Karma and Node are you using? |
Node 0.8.20 This bug probably is related to something being wrong in my tests, because now I'm running one test individually and it works ok. Any ideas of a pattern I should look for? |
My best guess would be that there is something in your tests that doesn't terminate correctly and then the browser is not ready when the second test runs. Try running both with |
Now it started to happen with a single test
and when the error comes, the browser is always
and never returns to "Idle" state. When I refresh Chrome it works:
It seems that the tests are not finishing, and the browser remains executing and never ends. I don't know why this behavior is not deterministic, though. Config file: |
Can you binary search for the test that is causing it and share the test ? Maybe we can prevent it from happening or at least show some error... |
I have been having this same problem, but I just found that it was running into confirm dialogs and location.href assignments and having problems with those. Once I get those cleared up I'll try again and see if I am still getting the same thing. |
Well, waiting for any dialog means the test did not finish and therefore We might intercept things like alerts() and stuff and at least show a On Thu, Mar 21, 2013 at 3:17 PM, Michael Bielski
|
Thank you Vojta, that would be helpful to see. I think we're looking into a different style of confirm dialog, one that would solve that problem. The redirects are still an issue though. I'm wondering if there is a way to mock the location object and add a preventDefault to the href assignment? Have to do some digging and see. |
You can do that inside your test code - if you really wanna call stuff like spyOn(window, 'alert'); We should definitely prevent page reload, there's already an issue for it #27. I'm adding a note to myself to consider patching |
@sammla Did you figure out which test is causing it ? |
I am not really sure it is one test, most probably there are a couple of tests that fire up this problem. It is not that easy to isolate them because of the non deterministic behavior, for example: I start Karma (with Chrome): If my problem was related to alerts or similar, wouldn't I get this issue on every run? I will try to look further to see if there is a pattern, or to make a smallest test possible that behaves this way, but there is the possibility that every single test works ok when runned alone... |
@ sammla If you can't figure it out. Could you show me your project ? Maybe On Fri, Mar 29, 2013 at 7:27 AM, Martin Paulucci
|
+1. I am also having this issue. |
Also having this issue. Tried Firefox and chrome. |
if i remove the REQUIRE and REQUIRE_ADAPTER lines from the files property in the config file everything seems to work again. |
same problem with my test.. ----------------e2e config --------
basePath = '../';
files = [
ANGULAR_SCENARIO,
ANGULAR_SCENARIO_ADAPTER,
'e2e/*.js'
];
autoWatch = false;
browsers = ['Chrome'];
singleRun = false;
proxies = {
'/' : 'http://localhost:8080/'
};
junitReporter = {
outputFile : 'test_out/e2e.xml',
suite : 'e2e'
}; -----Test Scenario---
'use strict';
describe("My Application", function () {
describe("Search View", function () {
beforeEach(function () {
browser().navigateTo("/index.html");
// console.log(browser().location().url())
// expect(browser().location().url()).toBe('/');
});
it('should have be true', function() {
input('field.serverName').enter('abc');
element('#onSearchButton','test').click();
expect(input('fields.serverName')).toBe('abc');
});
});
}); ----Output-----
Chrome 26.0 (Windows): Executed 0 of 1 DISCONNECTED (50.206 secs / 0 secs) |
same problem with me too. Worked for me too when I removed REQUIRE and REQUIRE_ADAPTER. any resolution on this? |
+1 For Require and Require_Adapter causing karma to fail, it's also specifically related to require_adapter, I can write a basic jasmine test, without using define etc. anything related to requirejs, and it still hangs as long as I use the require_adapter. -- update -- Actually I might of resolved my own issue, it might be due to the fact I had forgotten to always specifically load my main.js file, just a very strange reporting error. |
In general, when you get "delaying execution, waiting for...." that means the browser did not finish previous tests execution. @amchang that sounds like you never called @agsha can you make sure, you call |
@vojtajina Without backticks, |
@kjbekkelund thanks, I fixed the comment. |
@junaidabidi You are running e2e tests, so your problem is more likely something completely different, please create a separate issue. For those using Jasmine, I looked into @sammla 's project and found out something... Jasmine does setTimeout in this interval, so that the browser can "breath" - eg. if you are using html reporter, without this, it would only show the results at the end. Because this setTimeout, Jasmine gives the browser a chance to render. For some reason, sometimes this setTimeout never fires back. I have no idea why. Don't have time to dig into it now, but would be super awesome, if somebody could look into it. It's this code https://github.com/karma-runner/karma/blob/stable/adapter/lib/jasmine.js#L2164-L2168 where Jasmine does setTimeout to schedule running next specs (after browser renders). For some reason, this setTimeout is never fired and therefore it hangs (sometimes it does fire). Setting |
+1. Tests executes normally when I remove Require. Win 8 + Node v.0.10.5 + karma v.0.9.2 |
@johnkors does setting |
@vojtajina fyi: I am including the test spec js and all libraries required in |
@mohanraj-r I think we could simplify the init process for require, but having |
I had created an app using the angular-generator that comes with yeoman. |
https://github.com/karma-runner/karma/blob/stable/adapter/lib/jasmine.js#L2164-L2168 "^ this is not the webpage you are looking for" did anyone find a solution to this? I'm using mocha and getting the same error. module.exports = function(config) {
config.set({
basePath: './',
frameworks: ['requirejs', 'jquery', 'mocha', 'expect'],
plugins: ['karma-*', 'jquery'],
files: [
"public/stylesheets/style.css",
"public/javascripts/lib/jquery.js",
"public/javascripts/script.js"
],
//declaring jquery 3 times. i know. I don't know why it's necessary but it is for some reason.
exclude: [
'node_modules/*',
'**/*_ignore.js*'
],
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['progress, unicorn'],
port: 9876,
colors: true,
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
autoWatch: true,
// - Chrome, PhantomJS
browsers: [],
captureTimeout: 60000,
singleRun: false
});
}; |
@andrew-luhring Did you check the browser? Is there any error in the console? What is the "jquery" plugin? I dont' think that's a Karma plugin.... |
In case this helps anyone, my issue was with my Changing the pattern to |
@vojtajina the jquery plugin was me trying to include jquery. |
I ran into this problem the solution for me was adding port and runner port values to karma.unit in the Gruntfile.js solution was found here ngbp/ngbp#37 (comment) |
@andrew-luhring I don't see any "test-main.js" or something in your config. With require the tests has to be started asynchronously, after require is done with loading all the files. That's why you have to start karma through @andrewluetgers I really don't think specifying Anyway, this issue is becoming a mess. I'm closing it. Please open a new one if you still experiencing any of those issues or have any ideas how to improve it... Here's what we are going to do in order to fix these issues / make it simpler:
|
@vojtajina i made a video demonstrating the issue for you |
I've just been bit by this, and can reliably reproduce or not by having more than one testSpec.js file. That is, if all my tests are in a single file, it works fine. If I add a second fooSpec.js file in the watched directory, even if it contains no tests, the browser hangs always after first run. I very very highly suspect this is related to RequireJS. It took me a full 2 days to get Karma to work at all -- asked a lot of (unanswered) questions on SO, tried to get QUnit to work, eventually gave up, pounded my head for a while and managed to get Mocha running, migrated some of my QUnit tests to Mocha, was very happy. Then I decided it's time to split the monster test file back into per-module test files. And discovered this bug. Which is, obviously, a VERY SERIOUS bug. If I can add info to assist in resolving, let me know. I'm not in a good mood at this point about Karma, but maybe AMD is outside the normal usage? Unfortunately, for many like me, removing dependencies on AMD is not an option, and certainly not just to support a test runner. |
LOL @andrewluetgers nice vid :) Has this issue been considered resolved or what? Because it is not. And its a bit of a showstopper. Karma is awesome when it works, I'm glad I spent 2 days pulling my hair out to get it to work. But that awesomeness is predicated heavily on it actually working. I'm wondering why this thread died 2 months ago... |
Not sure if anyone reads closed issues, but updating with notes as I progress here: I have diffed the commits to my project between when this problem never occurred and when it always occurs. (Unfortunately it seems to always occur regardless of how many files are open, though that was definitely happening earlier.) I can switch between these commits and its extremely reproducible. What's frustrating is that the main activity in the broken commit was moving files around so its hard to see what changed, but I have confirmed that both karma.conf.js and test-main.js (setting up RequireJS) are binary identical between the two commits. Literally all other changes were to my project source and the unit tests. One thing I ruled out as the issue was that I added 'use strict' at file level to all my source. Not thinking that would be the problem, but very few actual code changes went into the commit. I paused the test runner in Chrome DevTools, since it says "executing" indefinitely. After a brief moment (not instantly) it paused at a websocket connection, but I could't discern any useful information about this. I suppose it confirms that the browser was not in fact "executing" anything that was causing it to hang, but as Vojta said, it may have been waiting indefinitely for something to indicate to continue. Inspecting my tests next, but it's worth pointing out, this problem occurs even with all tests commented out. |
I rolled back to last good commit, and bit by bit reconstructed every change I made -- all just moving files around. The problem never re-emerged. It's a mystery. If I encounter it again I'll post a new issue with more details. |
In case it helps anybody, I've isolated this scenario down to a single call in my own test setup: element.should.eql('anything can go here and cause a freeze'); It seems that should.js is not playing well with dom elements in Chrome and Safari. |
Same issue, tried Chrome and Safari. In the browser it displays the perpetual "xx is executing", and in the terminal it says: "Delaying execution, these browsers are not ready: Safari 7.0.4 (Mac OS X 10.9.3)". I installed Jasmine and Karma and upgraded Node just today. |
Please keep this issue open, I'm also running into the same problem: My config:
When I run `karma start karma.conf.js --single-run`` the server waits for connections:
If I check the console in the browser windows that open (Chrome and FF), there are no errors. THEN, when I run
What is going on? Why cant I run my tests? |
Found a fix for my own encounter with this issue (I am also using coffeescript). Switching my spec to use -> instead of => did it |
Hmmm also running into this problem with unit tests written in TypeScript. Versions: karma: 0.13.22 I'll play around with the configuration to see if I can get it to work. Karma runs fine with singleRun set to true. It's a great tool. |
Hi, I've been having this issue for a couple of weeks now, and its driving me nuts.
I have my setup configured to retest on every save, but now after a couple of changes in the code and saving, after 3 or 4 saves the tests don't run anymore and I get this message:
changing browser
As you can see, it happens when using Chrome as well as PhantomJS
Restarting Karma fixes the problem, but after a couple of saves I'm in the same situation.
Additional info: I'm on linux and using coffeescript.
The text was updated successfully, but these errors were encountered: