eolivelli commented on a change in pull request #112: Adding support for 
externally passed random seed and printing used seed on console
URL: https://github.com/apache/maven-surefire/pull/112#discussion_r195641956
 
 

 ##########
 File path: 
surefire-its/src/test/resources/testng-parallel-suites/src/test/java/testng/suiteXml/TestNGSuiteTest.java
 ##########
 @@ -28,16 +28,23 @@
  * @author <a href="mailto:[email protected]";>Tibor Digana (tibor17)</a>
  * @since 2.19
  */
-public class TestNGSuiteTest {
-       private static final AtomicInteger counter = new AtomicInteger();
+public class TestNGSuiteTest
+{
+    private static final AtomicInteger counter = new AtomicInteger();
 
-       @Test
-       public void shouldRunAndPrintItself()
-               throws Exception
-       {
-               System.out.println( getClass().getSimpleName() + 
"#shouldRunAndPrintItself() "
-                                                               + 
counter.incrementAndGet() + ".");
+    @Test
+    public void shouldRunAndPrintItself() throws Exception
+    {
+        String message = String.format(
+                "%s#shouldRunAndPrintItself() %d.",
+                getClass().getSimpleName(),
+                counter.incrementAndGet()
+        );
+        TimeUnit.SECONDS.sleep( 1 );
 
-               TimeUnit.SECONDS.sleep( 2 );
-       }
+        synchronized ( System.out )
 
 Review comment:
   This sounds strange, can you please explain why do we need this synchronized 
block?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to