diff --git a/test/hotspot/gtest/classfile/test_symbolTable.cpp b/test/hotspot/gtest/classfile/test_symbolTable.cpp
index b2f66b9c003..f569c4b5caa 100644
--- a/test/hotspot/gtest/classfile/test_symbolTable.cpp
+++ b/test/hotspot/gtest/classfile/test_symbolTable.cpp
@@ -139,7 +139,7 @@ public:
       st[i]->doit();
     }
 
-    for (int i = 0; i < 4; i++) {
+    for (int i = 0; i < SYM_TEST_THREAD_COUNT; i++) {
       done.wait();
     }
   }