mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed test suite timeout for multi-author posts
no issue - The timeout has been triggered due to lot's (25) of posts being inserted into the databse , which took over 20 000ms on Travis. - We don't need to insert this many posts in the first place to test the case - The reason why it is taking longer to do the insertion operation then before should be investigated separately
This commit is contained in:
parent
20a6ad1ea6
commit
634a9160a8
2 changed files with 10 additions and 9 deletions
|
@ -1559,18 +1559,18 @@ describe('Post Model', function () {
|
|||
var authorData = {id: testUtils.DataGenerator.Content.users[0].id};
|
||||
|
||||
models.Post.findAll({context: {internal: true}}).then(function (found) {
|
||||
// There are 25 posts created by posts:mu fixture
|
||||
found.length.should.equal(25);
|
||||
// There are 10 posts created by posts:mu fixture
|
||||
found.length.should.equal(10);
|
||||
return models.Post.destroyByAuthor(authorData);
|
||||
}).then(function (results) {
|
||||
// User 1 has 5 posts in the database (each user has proportionate amount)
|
||||
// 5 = 25 / 5 (posts / users)
|
||||
results.length.should.equal(5);
|
||||
// User 1 has 2 posts in the database (each user has proportionate amount)
|
||||
// 2 = 10 / 5 (posts / users)
|
||||
results.length.should.equal(2);
|
||||
return models.Post.findAll({context: {internal: true}});
|
||||
}).then(function (found) {
|
||||
// Only 20 should remain
|
||||
// 20 = 25 - 5
|
||||
found.length.should.equal(20);
|
||||
// Only 8 should remain
|
||||
// 8 = 10 - 2
|
||||
found.length.should.equal(8);
|
||||
done();
|
||||
}).catch(done);
|
||||
});
|
||||
|
|
|
@ -93,7 +93,8 @@ fixtures = {
|
|||
let i, j, k = 0,
|
||||
posts = [];
|
||||
|
||||
const count = 25;
|
||||
// NOTE: this variable should become a parameter as test logic depends on it
|
||||
const count = 10;
|
||||
|
||||
// insert users of different roles
|
||||
return Promise.resolve(fixtures.createUsersWithRoles()).then(function () {
|
||||
|
|
Loading…
Add table
Reference in a new issue