Add sort call to shard placement test

The comparator is kind of broken, but I think this is better than the
current state of random failures.
pull/807/head
Jason Petersen 2016-09-06 11:07:27 -05:00
parent 9ea36bb375
commit ce0a0ab813
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
2 changed files with 6 additions and 2 deletions

View File

@ -19,10 +19,12 @@
#include "access/heapam.h"
#include "catalog/pg_type.h"
#include "distributed/listutils.h"
#include "distributed/master_metadata_utility.h"
#include "distributed/master_protocol.h"
#include "distributed/metadata_cache.h"
#include "distributed/multi_join_order.h"
#include "distributed/multi_physical_planner.h"
#include "distributed/pg_dist_shard.h"
#include "distributed/resource_lock.h"
#include "distributed/test_helper_functions.h" /* IWYU pragma: keep */
@ -144,6 +146,8 @@ load_shard_placement_array(PG_FUNCTION_ARGS)
placementList = ShardPlacementList(shardId);
}
placementList = SortList(placementList, CompareShardPlacements);
placementCount = list_length(placementList);
placementDatumArray = palloc0(placementCount * sizeof(Datum));

View File

@ -128,7 +128,7 @@ ERROR: could not find valid entry for shard 540005
SELECT load_shard_placement_array(540001, false);
load_shard_placement_array
-----------------------------------
{localhost:57637,localhost:57638}
{localhost:57638,localhost:57637}
(1 row)
-- only one of which is finalized
@ -142,7 +142,7 @@ SELECT load_shard_placement_array(540001, true);
SELECT load_shard_placement_array(540001, false);
load_shard_placement_array
-----------------------------------
{localhost:57637,localhost:57638}
{localhost:57638,localhost:57637}
(1 row)
-- should see column id of 'name'