-
Notifications
You must be signed in to change notification settings - Fork 38
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
Client-side test fails after two server-side tests #77
Comments
I just found that when you place an additional |
Might actually be related to #48 |
I found that when you set your initial apps in the AppPool to a number high enough to execute every test on one of those initially started apps (in this case here
Delaying the emission of |
I got it. I'm going to make a pull request for the fix... |
Hey Blazer82. It seems this issue exits again as of meteor 8.1.1. Yesterday I was running test and when I swapped the order around, it consistently failed every third test. Adding a server side eval like you said a few comments ago does fix the problem. Laika -v is 0.3.9 and node -v is 0.10.28 Code is below. Please see issue #117 // Login.js
var assert = require('assert');
suite('Home Page', function() {
test('should display a login link instead of username when not logged in', function(done, server, client) {
client.eval(function() {
Router.go('/');
waitForDOM('li', function() {
emit('login-link-text', $('#sign-in-button').text());
});
emit('return');
}).once('login-link-text', function(text) {
assert.equal(text, 'Sign In');
}).once('return', function() {
done();
});
// allows 3rd test to pass
server.eval(function() {
emit('return');
}).once('return', function() {
done();
});
});
}); // promotions.js
var assert = require('assert');
suite('Promotions', function() {
test('in the server', function(done, server) {
server.eval(function() {
Promotions.insert({
promoName: 'testName',
blurb: 'test',
latitude: '43.011338',
longitude: '-83.713344',
startDate: 'Jul 9th, 2009',
endDate: 'Dec 23rd, 2012',
daysBetween: '1264',
author: 'admin'
});
var docs = Promotions.find({promoName: 'testName'}).fetch();
emit('docs', docs);
}).once('docs', function(docs) {
assert.equal(docs.length, 1);
done();
});
});
test('access denied when not logged in', function(done, server, client) {
client.eval(function() {
Promotions.find().observe({
removed: onRemoved
});
function onRemoved(promotion) {
emit('remove', promotion);
emit('return');
}
Promotions.insert({promoName: 'testRemove'});
}).once('remove', function(promotion) {
assert.equal(promotion.promoName, 'testRemove');
}).once('return', function() {
done();
});
// allows 3rd test to pass
server.eval(function() {
emit('return');
}).once('return', function() {
done();
});
});
}); |
I have a really strange behavior with my test suite: After two server-side tests the next client-side test fails because of a timeout, always and even if the timeout is set to really high values. I tried to track it down but wasn't able to find anything. It seems to be completely independent of any meteor app, since it's easily reproducible in another app. All you need to do is to run the following tests:
Nothing special here, just some asserting that
true
equalstrue
.And if you remove the first or the second test, everything works fine again.
I noticed something strange during the execution of the third test. It seems as if the app is getting launched three times:
You can place all those tests within the same suite and you'll get the same results.
So far, I found no way to avoid this problem.
Any ideas what might be causing this?
The text was updated successfully, but these errors were encountered: