Skip to content

Commit

Permalink
Tests: Fix one more random failure (#9004)
Browse files Browse the repository at this point in the history
refs #7470

- this should fix #7470 (comment)
- the importer adds posts in parallel, but the tests read directly from the db without any order
- use findPage (findAll does not support order yet)
  • Loading branch information
kirrg001 authored and ErisDS committed Sep 12, 2017
1 parent 4237446 commit aef3d7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/test/integration/data/importer/importers/data_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('Import', function () {
// Grab the data from tables
return Promise.all([
knex('users').select(),
knex('posts').select(),
models.Post.findPage(testUtils.context.internal),
knex('settings').select(),
knex('tags').select(),
knex('subscribers').select()
Expand All @@ -139,7 +139,7 @@ describe('Import', function () {
importedData.length.should.equal(5, 'Did not get data successfully');

var users = importedData[0],
posts = importedData[1],
posts = importedData[1].posts,
settings = importedData[2],
tags = importedData[3],
subscribers = importedData[4];
Expand All @@ -151,8 +151,8 @@ describe('Import', function () {

// import no longer requires all data to be dropped, and adds posts
posts.length.should.equal(exportData.data.posts.length, 'Wrong number of posts');
posts[0].status.should.eql('published');
posts[1].status.should.eql('scheduled');
posts[0].status.should.eql('scheduled');
posts[1].status.should.eql('published');

// test settings
settings.length.should.be.above(0, 'Wrong number of settings');
Expand Down

0 comments on commit aef3d7f

Please sign in to comment.