diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php
index db16052ed107f1d8196cfb89f409134832d5f971..80ab8074410938752d02bc89d2dd415ba98ab42f 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCommentsHistory.php
@@ -47,6 +47,7 @@ class AssertRefundInCommentsHistory extends AbstractConstraint
                 unset($comments[$key]);
             }
         }
+        $comments = array_values($comments);
 
         foreach ($refundedPrices as $key => $refundedPrice) {
             \PHPUnit_Framework_Assert::assertRegExp(