[jboss-jira] [JBoss JIRA] Commented: (JBASM-28) testTimeoutStop test failure since changes to ServerController.java were implemented

Richard Achmatowicz (JIRA) jira-events at lists.jboss.org
Thu Feb 12 21:20:54 EST 2009


    [ https://jira.jboss.org/jira/browse/JBASM-28?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12452500#action_12452500 ] 

Richard Achmatowicz commented on JBASM-28:
------------------------------------------

OK. I'm sorry about deleting the copy of ServerController.java from trunk. Blame it on Eclipse.

The last commit to the codebase was by alex, numbered 82586. My deletion of ServerController was 84003. My re-addition of ServerControoler was 84021.

The diff between 84021 and 82586 is below:

Index: /home/nrla/eclipse-AS5/server-manager-trunk/src/main/java/org/jboss/jbossas/servermanager/ServerManager.java
===================================================================
--- /home/nrla/eclipse-AS5/server-manager-trunk/src/main/java/org/jboss/jbossas/servermanager/ServerManager.java	(.../home/nrla/eclipse-AS5/server-manager-trunk)	(working copy)
+++ /home/nrla/eclipse-AS5/server-manager-trunk/src/main/java/org/jboss/jbossas/servermanager/ServerManager.java	(.../http://anonsvn.jboss.org/repos/jbossas/projects/server-manager/trunk)	(revision 82586)
@@ -74,14 +74,14 @@
                Server server = iter.next();
                if (server!=null && server.isRunning())
                {
-                  System.err.println("Testsuite shutdown hook found server \""+server.getName()+"\" still running; stopping it.");
+                  System.err.println("Found server \""+server.getName()+"\" still running; stopping it.");
                   try
                   {
                      ServerController.stopServer(server, ServerManager.this);
                   }
                   catch (IOException e)
                   {
-                     System.err.println("Testsuite shutdown hook failed to stop server(s) on shutdown.");
+                     System.err.println("Failed to stop server(s) on shutdown.");
                      e.printStackTrace(System.err);
                   }
                }
Index: /home/nrla/eclipse-AS5/server-manager-trunk/src/main/java/org/jboss/jbossas/servermanager/ServerController.java
===================================================================
--- /home/nrla/eclipse-AS5/server-manager-trunk/src/main/java/org/jboss/jbossas/servermanager/ServerController.java	(.../home/nrla/eclipse-AS5/server-manager-trunk)	(working copy)
+++ /home/nrla/eclipse-AS5/server-manager-trunk/src/main/java/org/jboss/jbossas/servermanager/ServerController.java	(.../http://anonsvn.jboss.org/repos/jbossas/projects/server-manager/trunk)	(revision 82586)
@@ -39,7 +39,7 @@
  * Starts, stops, and (eventually) reboots server instances.
  * 
  * @author <a href="ryan.campbell at jboss.com">Ryan Campbell</a>
- * @version $Revision: 82586 $
+ * @version $Revision$
  */
 public abstract class ServerController
 {
@@ -117,12 +117,10 @@
       }
       catch (IOException e)
       {
-     	 // this affects the value of Server.isStopped()
          server.setProcess(null);
          throw e;
       }
-      
-      System.out.println("Server started.") ;
+
    }
 
    /** 
@@ -259,11 +257,6 @@
       {
          if (!server.isRunning())
          {
-         	// save output and error streams before raising exception (and terminating ant task)
-         	closeAllStreams(server.getProcess()) ;
-         	server.getErrorWriter().close() ;
-         	server.getOutWriter().close() ;
-         	
             throw new IOException("Server failed to start; see logs. exit code: " + server.getProcess().exitValue());
          }
 
@@ -281,12 +274,6 @@
       }
 
       Process process = server.getProcess();
-      
-  	  // save output and error streams before raising exception (and terminating ant task)
-  	  closeAllStreams(server.getProcess()) ;
-  	  server.getErrorWriter().close() ;
-  	  server.getOutWriter().close() ;
-      
       System.err.println("Failed to start server \"" + server.getName()
             + "\" before timeout. Destroying the process.");
       process.destroy();
@@ -426,8 +413,14 @@
       server.getErrorWriter().close();
       server.getOutWriter().close();
 
-  	  // this affects the value of Server.isStopped()
       server.setProcess(null);
+      try
+      {
+         Thread.sleep(45000);
+      }
+      catch (InterruptedException e)
+      {
+      }
 
       if (!cleanShutdown)
       {
@@ -437,8 +430,6 @@
             + "Process was destroyed."
             ).initCause(shutdownException);
       }
-      
-      System.out.println("Server stopped.") ;
    }
 
    /**
@@ -539,7 +530,7 @@
     * A OutputPumper.  Redirect std err & out to log files.
     * 
     * @author <a href="ryan.campbell at jboss.com">Ryan Campbell</a>
-    * @version $Revision: 82586 $
+    * @version $Revision$
     */
    private static class OutputPumper extends Thread
    {


These are the changes I made to ServerController. I made one other cosmetic change to ServerManager. 
Thing to do first is to check out revision 82586 and see if the test fails there. If so, my changes did not affect things.
I'll look at it in the next days.

BTW, instead of recommitting ServerController.java, I should have reverted the changes and started over. Mistake on my part as it caused the history of the file ServerContoller to be lost. But you can still see it all before the deletion.

  

> testTimeoutStop test failure since changes to ServerController.java were implemented
> ------------------------------------------------------------------------------------
>
>                 Key: JBASM-28
>                 URL: https://jira.jboss.org/jira/browse/JBASM-28
>             Project: JBoss AS Server Manager
>          Issue Type: Bug
>            Reporter: Shelly McGowan
>            Assignee: Richard Achmatowicz
>
> Richard, I'll have to ask you to take a look at these.    They seem to occur since the changes you've committed.  After losing the history of ServerController.java it is difficult to know what was exactly changed.  To run the tests, you will need an  JBoss AS 5 installation built as the tests start and stop the default server config.
> -------------------------------------------------------------------------------
> Test set: org.jboss.jbossas.servermanager.test.startstop.unit.FailStartStopTest
> -------------------------------------------------------------------------------
> Tests run: 3, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 107.081 sec <<< FAILURE!
> <testcase classname="org.jboss.jbossas.servermanager.test.startstop.unit.FailStartStopTest" time="107.059" name="testTimeoutStop">
>     <error type="java.lang.IllegalArgumentException" message="The default is not running; it cannot be stopped.">java.lang.IllegalArgumentException: The default is not running; it cannot be stopped.
>         at org.jboss.jbossas.servermanager.ServerController.stopServer(ServerController.java:373)
>         at org.jboss.jbossas.servermanager.test.startstop.unit.FailStartStopTest.after(FailStartStopTest.java:227)
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list