diff --git a/core/types/transaction_test.go b/core/types/transaction_test.go
index 30ecb84ddb4e70dbdd9458868d279bab4da3d05d..82d74e3b34ce1c543020ceabc397f5f895da0201 100644
--- a/core/types/transaction_test.go
+++ b/core/types/transaction_test.go
@@ -147,12 +147,12 @@ func TestTransactionPriceNonceSort(t *testing.T) {
 	txset := NewTransactionsByPriceAndNonce(signer, groups)
 
 	txs := Transactions{}
-	for {
-		if tx := txset.Peek(); tx != nil {
-			txs = append(txs, tx)
-			txset.Shift()
-		}
-		break
+	for tx := txset.Peek(); tx != nil; tx = txset.Peek() {
+		txs = append(txs, tx)
+		txset.Shift()
+	}
+	if len(txs) != 25*25 {
+		t.Errorf("expected %d transactions, found %d", 25*25, len(txs))
 	}
 	for i, txi := range txs {
 		fromi, _ := Sender(signer, txi)