From 8202f813ed8a02bf441e2f7cef7b4436334c0fd6 Mon Sep 17 00:00:00 2001 From: Alexei Pastuchov Date: Tue, 7 Jul 2026 14:02:41 +0200 Subject: [PATCH] Assert aggregated content in gearman_execute_partition_basic gearman_execute_partition_basic only checked the aggregated result size (18 bytes), so the reduce-step ordering change from PR #435 (cat_aggregator_fn now walks the task list in FIFO/submission order instead of LIFO) could silently flip word order without failing any test. Pin the concatenation order down explicitly. Fixes #464 Signed-off-by: Alexei Pastuchov --- tests/libgearman-1.0/gearman_execute_partition.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/libgearman-1.0/gearman_execute_partition.cc b/tests/libgearman-1.0/gearman_execute_partition.cc index f9753f690..795553741 100644 --- a/tests/libgearman-1.0/gearman_execute_partition.cc +++ b/tests/libgearman-1.0/gearman_execute_partition.cc @@ -154,6 +154,13 @@ test_return_t gearman_execute_partition_basic(void *object) ASSERT_TRUE(value); ASSERT_EQ(18UL, gearman_result_size(result)); + // cat_aggregator_fn() concatenates the sub-task results in task-list + // order, which is submission order (FIFO, since PR #435). split_worker() + // splits "this dog does not hunt" on spaces in left-to-right order, so + // the aggregated result is expected to be the words back-to-back in + // their original order. + test_memcmp("thisdogdoesnothunt", value, 18); + gearman_task_free(task); gearman_client_task_free_all(client);