Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-11126

RunTestCase#testJBossInBackgroundPlusPidFile() fails on RHEL4

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • EAP_EWP 5.3.0.GA
    • EAP_EWP 5.3.0.ER3
    • Testsuite
    • None
    • NEW

    Description

      org.jboss.test.scripts.test.RunTestCase#testJBossInBackgroundPlusPidFile() is failing on RHEL4. Server fails to start during the test:

      created pidFile: /tmp/jbosspidfile692194462636245213.tmp
      ShellScriptExecutor: executing shell command -> bash -c ./run.sh -c production -b localhost 
      Process terminated with exit code 0
      Exception: message = Server failed to start: couldn't connect to Tomcat. See logs.
      ============================== system.out ==============================
      =========================================================================
      
        JBoss Bootstrap Environment
      
        JBOSS_HOME: /qa/services/hudson/users-tmp/pkremens/eap/jboss-eap-5.3/jboss-as
      
        JAVA: java
      
        JAVA_OPTS: -Dprogram.name=run.sh -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.C        lassLoader.allowArraySyntax=true -Djava.net.preferIPv4Stack=true
      
        CLASSPATH: /qa/services/hudson/users-tmp/pkremens/eap/jboss-eap-5.3/jboss-as/bin/run.jar
      
      =========================================================================
      
      7568
      
      ============================== system.err ==============================
      ./run.sh: line 377: java: command not found
      
      ========================================================================
      waitForServerStop: waiting 40 seconds
      

      Correct fix is to update existing environment properties with LAUNCH_JBOSS_IN_BACKGROUND and JBOSS_PIDFILE, and pass them to server start command.

      30,31c30,31
      < 
      < 
      ---
      > import java.util.Map;
      > import java.util.Arrays;
      231c231
      <       String[] envp = new String[] { "LAUNCH_JBOSS_IN_BACKGROUND=true", "JBOSS_PIDFILE=" + pidFile.getAbsolutePath() };
      ---
      >       String[] envp = updateEnvs("LAUNCH_JBOSS_IN_BACKGROUND=true", "JBOSS_PIDFILE=" + pidFile.getAbsolutePath());
      286a287,303
      > 
      >     /**
      >      * Update existing environment properties.
      >      *
      >      * @param extraEnv Extra environment properties.
      >      * @return String array of updated environment properties.
      >      */
      >     private String[] updateEnvs(String... extraEnv) {
      >         Map<String, String> envMap = System.getenv();
      >         int index = extraEnv.length;
      >         String[] envs = Arrays.copyOf(extraEnv, index + envMap.size());
      >         for (Map.Entry<String, String> entry : envMap.entrySet()) {
      >             envs[index++] = entry.getKey() + "=" + entry.getValue();
      >         }
      >         return envs;
      >     }
      > 
      

      Attachments

        1. diff
          0.9 kB
        2. RunTestCase.java
          12 kB

        Activity

          People

            pjelinek@redhat.com Pavel Jelinek
            pkremens@redhat.com Petr Kremensky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: