From 6549a3a02356f95a4a00f36aaaac39ff1a167521 Mon Sep 17 00:00:00 2001 From: Raul Marin Date: Wed, 10 Apr 2019 16:22:31 +0200 Subject: [PATCH] Agg tests: Sort before compare to avoid failures due to paralellism --- test/acceptance/cluster.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/acceptance/cluster.js b/test/acceptance/cluster.js index d668745a..840757a8 100644 --- a/test/acceptance/cluster.js +++ b/test/acceptance/cluster.js @@ -555,7 +555,14 @@ describe('cluster', function () { return done(err); } - assert.deepStrictEqual(body.rows, expected); + const sort_f = ((a, b) => { + return (a._cdb_feature_count < b._cdb_feature_count) || + (a._cdb_feature_count === b._cdb_feature_count && + (a.type < b.type || + a.type === b.type && a.max_value < b.max_value)); + }); + + assert.deepStrictEqual(body.rows.sort(sort_f), expected.sort(sort_f)); testClient.drain(done); });