test: determistic concurreny for `TestDb`

pull/24376/head
Marco Neumann 2021-08-02 18:35:43 +02:00
parent a2bc97b923
commit ed70b73fd8
2 changed files with 9 additions and 5 deletions

View File

@ -1473,7 +1473,7 @@ mod tests {
"| physical_plan | SortExec: [bar@0 ASC] |",
"| | CoalescePartitionsExec |",
"| | ProjectionExec: expr=[bar@0 as bar, tag_partition_by@1 as tag_partition_by, time@2 as time] |",
"| | RepartitionExec: partitioning=RoundRobinBatch(8) |",
"| | RepartitionExec: partitioning=RoundRobinBatch(4) |",
"| | IOxReadFilterNode: table_name=table_1, chunks=1 predicate=Predicate |",
"+---------------+-------------------------------------------------------------------------------------------------+",
],
@ -1566,11 +1566,11 @@ mod tests {
"| | CoalescePartitionsExec |",
"| | ProjectionExec: expr=[bar@0 as bar, tag_partition_by@1 as tag_partition_by, time@2 as time] |",
"| | ExecutionPlan(PlaceHolder) |",
"| | RepartitionExec: partitioning=RoundRobinBatch(8) |",
"| | RepartitionExec: partitioning=RoundRobinBatch(4) |",
"| | DeduplicateExec: [tag_partition_by@1 ASC,time@2 ASC] |",
"| | SortExec: [tag_partition_by@1 ASC,time@2 ASC] |",
"| | IOxReadFilterNode: table_name=table_1, chunks=1 predicate=Predicate |",
"| | RepartitionExec: partitioning=RoundRobinBatch(8) |",
"| | RepartitionExec: partitioning=RoundRobinBatch(4) |",
"| | IOxReadFilterNode: table_name=table_1, chunks=1 predicate=Predicate |",
"+---------------+-------------------------------------------------------------------------------------------------+",
],
@ -1587,7 +1587,7 @@ mod tests {
"| physical_plan | ProjectionExec: expr=[bar@0 as bar, tag_partition_by@1 as tag_partition_by, time@2 as time] |",
"| | CoalesceBatchesExec: target_batch_size=500 |",
"| | FilterExec: bar@0 <= CAST(10 AS Float64) |",
"| | RepartitionExec: partitioning=RoundRobinBatch(8) |",
"| | RepartitionExec: partitioning=RoundRobinBatch(4) |",
"| | IOxReadFilterNode: table_name=table_1, chunks=1 predicate=Predicate exprs: [#bar LtEq Int64(10)] |",
"+---------------+----------------------------------------------------------------------------------------------------------+",
],

View File

@ -59,7 +59,11 @@ impl TestDbBuilder {
.object_store
.unwrap_or_else(|| Arc::new(ObjectStore::new_in_memory()));
let exec = Arc::new(Executor::new(1));
// deterministic thread and concurrency count
let mut exec = Executor::new(1);
exec.config_mut().set_concurrency(4);
let exec = Arc::new(exec);
let metrics_registry = Arc::new(metrics::MetricRegistry::new());
let (preserved_catalog, catalog, replay_plan) = load_or_create_preserved_catalog(