diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
index d6da254..db7ce31 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
@@ -174,10 +174,12 @@ function testRangeUndo() {
   function testDistinct() {
     $query = db_select('test_task');
     $query->addField('test_task', 'task');
+    $query->orderBy('task');
     $query->distinct();
-    $query_result = $query->countQuery()->execute()->fetchField();
+    $query_result = $query->execute()->fetchAll(\PDO::FETCH_COLUMN);

-    $this->assertEqual($query_result, 6, 'Returned the correct number of rows.');
+    $expected_result = ['code', 'eat', 'found new band', 'perform at superbowl', 'sing', 'sleep'];
+    $this->assertEqual($query_result, $expected_result, 'Returned the correct result.');
   }

   /**
