Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-7167

The HTML rendering of tests is no longer working when tests fail

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: framework
    • Labels:
      None

      Description

      This is a regression introduced with the changes on the start component at r1745351

      Here are the facts:
      This is "Ant run-tests" done with the last commit (1741595) just before http://svn.apache.org/viewvc?view=revision&revision=1745351 (ie the 1st major set of changes on the start component, not the previous refactorings)
      After an "ant load-demo" I manually loaded the data from http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml?r1=532739&r2=532738&pathrev=532739 to get an error because the tests HTML result works when there are no errors

      [java] Java Result: 99
          [mkdir] Created dir: c:\projectsASF\ofbiz\runtime\logs\test-results\html
      [junitreport] Processing c:\projectsASF\ofbiz\runtime\logs\test-results\TESTS-TestSuites.xml to C:\Users\Jacques\AppData\Local\Temp\null1427022184
      [junitreport] Loading stylesheet jar:file:/C:/projectsASF/ofbiz/framework/base/lib/ant-1.9.0-ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
      [junitreport] Transform time: 755ms
      [junitreport] Deleting: C:\Users\Jacques\AppData\Local\Temp\null1427022184
      
      BUILD FAILED
      c:\projectsASF\ofbiz\build.xml:1196: Test run was unsuccessful
      
      Total time: 5 minutes 17 seconds
      c:\projectsASF\ofbiz>svn info
      [...]
      révision: 1741595
      [...]
      Date de la dernière modification: 2016-04-29 09:53:44 +0200 (ven. 29 avr. 2016)
      

      "Ant run-tests" done with r1745351
      Same data condition

           [java] 2016-06-03 13:42:24,510 |main                 |ServiceDispatcher             |T| Sync service [test-dispatcher-5tNK2Gmh9e/createExample] finished in [95] milliseconds
           [java] org.ofbiz.base.start.StartupException: Cannot start() org.ofbiz.testtools.TestRunContainer (Test run was unsuccessful)
           [java]     at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:239)
           [java]     at org.ofbiz.base.start.Start.startStartLoaders(Start.java:446)
           [java]     at org.ofbiz.base.start.Start.start(Start.java:191)
           [java]     at org.ofbiz.base.start.Start.main(Start.java:88)
           [java] Caused by: org.ofbiz.base.container.ContainerException: Test run was unsuccessful
           [java]     at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:193)
           [java]     at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237)
           [java]     ... 3 more
           [java] Exception in thread "main" org.ofbiz.base.start.StartupException: java.lang.Exception: Error during start. (Error during start.)
           [java]     at org.ofbiz.base.start.Start.main(Start.java:91)
           [java] Caused by: java.lang.Exception: Error during start.
           [java]     at org.ofbiz.base.start.Start.start(Start.java:195)
           [java]     at org.ofbiz.base.start.Start.main(Start.java:88)
           [java] 2016-06-03 13:42:24,539 |main                 |UtilProperties                |I| ResourceBundle ExampleEntityLabels (en) created in 0.028s with 23 properties
           [java] 2016-06-03 13:42:24,540 |main                 |ServiceDispatcher             |T| Sync service [test-dispatcher-5tNK2Gmh9e/testCreateExampleService] finished in [135] milliseconds
           [java] 2016-06-03 13:42:24,540 |main                 |TestRunContainer              |I| [JUNIT] : testCreateExampleService Through Service Engine finished.
           [java] 2016-06-03 13:42:24,540 |main                 |TestRunContainer              |I| [JUNIT] : testCreateExampleService Direct Simple Method starting...
           [java] 2016-06-03 13:42:24,542 |main                 |ServiceEcaRule                |I| Running Service ECA Service: createExampleStatus, triggered by rule on Service: createExample
           [java] 2016-06-03 13:42:24,544 |main                 |ServiceDispatcher             |T| Sync service [test-dispatcher-5tNK2Gmh9e/createExampleStatus] finished in [2] milliseconds
           [java] 2016-06-03 13:42:24,545 |main                 |ServiceDispatcher             |T| Sync service [test-dispatcher-5tNK2Gmh9e/createExample] finished in [3] milliseconds
           [java] 2016-06-03 13:42:24,546 |main                 |TestRunContainer              |I| [JUNIT] : testCreateExampleService Direct Simple Method finished.
           [java] 2016-06-03 13:42:24,546 |main                 |GenericDelegator              |I| Rolling back 4 entity operations
           [java] 2016-06-03 13:42:24,564 |main                 |TestRunContainer              |I| [JUNIT] Results for test suite: example-tests
           [java] 2016-06-03 13:42:24,564 |main                 |TestRunContainer              |I| [JUNIT] Pass: true | # Tests: 5 | # Failed: 0 # Errors: 0
           [java] Exception in thread "Thread-47" java.lang.RuntimeException: org.ofbiz.minilang.MiniLangException: Could not find SimpleMethod testIfRegexp in XML document in resource: component://minilang/script/
      org/ofbiz/minilang/method/ifops/IfRegexpTests.xml
           [java]     at org.ofbiz.minilang.method.ifops.test.IfRegexpTest$MyThread.run(IfRegexpTest.java:82)
           [java] Caused by: org.ofbiz.minilang.MiniLangException: Could not find SimpleMethod testIfRegexp in XML document in resource: component://minilang/script/org/ofbiz/minilang/method/ifops/IfRegexpTests.xml
      
           [java]     at org.ofbiz.minilang.SimpleMethod.runSimpleMethod(SimpleMethod.java:272)
           [java]     at org.ofbiz.minilang.method.ifops.test.IfRegexpTest$MyThread.run(IfRegexpTest.java:74)
      Terminer le programme de commandes (O/N)�? o
      

      The tests then block indefinitely in this state and the only way to stop the process is to use Ctrl+C.
      As you can see it's ambiguous because the changes introduced with r1745351 revealed an issue with the testIfRegexp. I fixed it at r1745451 and then it's obvious that the problem remains and is related with r1745351


           [java] 2016-06-03 14:01:19,672 |main                 |TestRunContainer              |I| [JUNIT] Results for test suite: example-tests
           [java] 2016-06-03 14:01:19,672 |main                 |TestRunContainer              |I| [JUNIT] Pass: true | # Tests: 5 | # Failed: 0 # Errors: 0
           [java] Exception in thread "main" org.ofbiz.base.start.StartupException: Cannot start() org.ofbiz.testtools.TestRunContainer (Test run was unsuccessful)
           [java]     at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:239)
           [java]     at org.ofbiz.base.start.StartupControlPanel.startStartupLoaders(StartupControlPanel.java:285)
           [java]     at org.ofbiz.base.start.StartupControlPanel.start(StartupControlPanel.java:107)
           [java]     at org.ofbiz.base.start.Start.main(Start.java:84)
           [java] Caused by: org.ofbiz.base.container.ContainerException: Test run was unsuccessful
           [java]     at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:193)
           [java]     at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237)
           [java]     ... 3 more
      Terminer le programme de commandes (O/N)? o
      
      c:\projectsASF\ofbiz>time
      L'heure actuelle est : 14:34:20,60
      
      c:\projectsASF\ofbiz>svn info
      c:\projectsASF\ofbiz>svn info
      [...]
      révision: 1745451
      [...]
      Date de la dernière modification: 2016-05-25 10:36:57 +0200 (mer. 25 mai 2016)
      

        Issue Links

          Activity

          Hide
          taher Taher Alkhateeb added a comment -

          Hi Jacques,

          OK, so can you confirm that we have 2 separate unrelated issues at hand:
          1- If all tests do not pass, then HTML is not rendered
          2- Someone introduced a commit that fails one of the tests

          So if we fix the failing test, then the issue would still remain on HTML not being rendered.

          Can you confirm this?

          Show
          taher Taher Alkhateeb added a comment - Hi Jacques, OK, so can you confirm that we have 2 separate unrelated issues at hand: 1- If all tests do not pass, then HTML is not rendered 2- Someone introduced a commit that fails one of the tests So if we fix the failing test, then the issue would still remain on HTML not being rendered. Can you confirm this?
          Hide
          jacques.le.roux Jacques Le Roux added a comment - - edited

          Yes, If there are no tests failing the HTML rendering works. But as soon as one test fails we don't get the HTML rendering. This is because an issue is thrown when the test fails, look for

          throw new ContainerException("Test run was unsuccessful");

          And I believe then this triggers a StartupException
          See what happens here:

            [java] 2016-06-03 15:43:53,706 |main                 |TestRunContainer              |I| [JUNIT] Results for test suite: example-tests
            [java] 2016-06-03 15:43:53,706 |main                 |TestRunContainer              |I| [JUNIT] Pass: true | # Tests: 5 | # Failed: 0 # Errors: 0
            [java] Exception in thread "main" org.ofbiz.base.start.StartupException: Cannot start() org.ofbiz.testtools.TestRunContainer (Test run was unsuccessful)
            [java]     at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:239)
            [java]     at org.ofbiz.base.start.StartupControlPanel.startStartupLoaders(StartupControlPanel.java:270)
            [java]     at org.ofbiz.base.start.StartupControlPanel.start(StartupControlPanel.java:107)
            [java]     at org.ofbiz.base.start.Start.main(Start.java:84)
            [java] Caused by: org.ofbiz.base.container.ContainerException: Test run was unsuccessful
            [java]     at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:193)
            [java]     at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237)
            [java]     ... 3 more
            [java] 2016-06-03 16:41:26,700 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
            [java] 2016-06-03 16:41:26,702 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
            [java] 2016-06-03 16:41:56,710 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
            [java] 2016-06-03 16:41:56,711 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
            [java] 2016-06-03 16:41:56,711 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
            [java] 2016-06-03 16:41:56,712 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
            [java] 2016-06-03 16:41:56,713 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
            [java] 2016-06-03 16:41:56,713 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
            [java] 2016-06-03 16:41:56,714 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
            [java] 2016-06-03 16:41:56,715 |andardHost[0.0.0.0]] |ControlEventListener          |I| Destroying session:  hidden sessionId by default.
          

          HTH, I have to move...

          Show
          jacques.le.roux Jacques Le Roux added a comment - - edited Yes, If there are no tests failing the HTML rendering works. But as soon as one test fails we don't get the HTML rendering. This is because an issue is thrown when the test fails, look for throw new ContainerException("Test run was unsuccessful"); And I believe then this triggers a StartupException See what happens here: [java] 2016-06-03 15:43:53,706 |main |TestRunContainer |I| [JUNIT] Results for test suite: example-tests [java] 2016-06-03 15:43:53,706 |main |TestRunContainer |I| [JUNIT] Pass: true | # Tests: 5 | # Failed: 0 # Errors: 0 [java] Exception in thread "main" org.ofbiz.base.start.StartupException: Cannot start() org.ofbiz.testtools.TestRunContainer (Test run was unsuccessful) [java] at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:239) [java] at org.ofbiz.base.start.StartupControlPanel.startStartupLoaders(StartupControlPanel.java:270) [java] at org.ofbiz.base.start.StartupControlPanel.start(StartupControlPanel.java:107) [java] at org.ofbiz.base.start.Start.main(Start.java:84) [java] Caused by: org.ofbiz.base.container.ContainerException: Test run was unsuccessful [java] at org.ofbiz.testtools.TestRunContainer.start(TestRunContainer.java:193) [java] at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237) [java] ... 3 more [java] 2016-06-03 16:41:26,700 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . [java] 2016-06-03 16:41:26,702 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . [java] 2016-06-03 16:41:56,710 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . [java] 2016-06-03 16:41:56,711 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . [java] 2016-06-03 16:41:56,711 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . [java] 2016-06-03 16:41:56,712 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . [java] 2016-06-03 16:41:56,713 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . [java] 2016-06-03 16:41:56,713 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . [java] 2016-06-03 16:41:56,714 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . [java] 2016-06-03 16:41:56,715 |andardHost[0.0.0.0]] |ControlEventListener |I| Destroying session: hidden sessionId by default . HTH, I have to move...
          Hide
          taher Taher Alkhateeb added a comment -

          Jacques .. you are awesome!

          Ok, this narrows it down, I think it has to do with my refactoring to unify the exception model so something creeps and bubbles its way up to main

          I'll dig some more and try to resolve it.

          Show
          taher Taher Alkhateeb added a comment - Jacques .. you are awesome! Ok, this narrows it down, I think it has to do with my refactoring to unify the exception model so something creeps and bubbles its way up to main I'll dig some more and try to resolve it.
          Hide
          taher Taher Alkhateeb added a comment -

          OK, got the offending bit

          StartupControlPanel.startStartupLoaders throws an exception that bubbles to main

          The problem is that when the exception bubbles to main the other threads are not shutdown and so the system is stuck. In the old code we used to call System.exit(99)

          I will provide a patch

          Show
          taher Taher Alkhateeb added a comment - OK, got the offending bit StartupControlPanel.startStartupLoaders throws an exception that bubbles to main The problem is that when the exception bubbles to main the other threads are not shutdown and so the system is stuck. In the old code we used to call System.exit(99) I will provide a patch
          Hide
          taher Taher Alkhateeb added a comment -

          Hi Jacques,

          Fixed in r1746737. I simply need to catch the exception in main and terminate with System.exit(99).

          Cheers

          Taher Alkhateeb

          Show
          taher Taher Alkhateeb added a comment - Hi Jacques, Fixed in r1746737. I simply need to catch the exception in main and terminate with System.exit(99). Cheers Taher Alkhateeb
          Hide
          taher Taher Alkhateeb added a comment -

          I will leave this JIRA open until you confirm Jacques. Again, thank you! you've been a great asset in this process

          Show
          taher Taher Alkhateeb added a comment - I will leave this JIRA open until you confirm Jacques. Again, thank you! you've been a great asset in this process
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          A big thank you for you too Taher. As you mentionned on dev ML this is now fixed

          Show
          jacques.le.roux Jacques Le Roux added a comment - A big thank you for you too Taher. As you mentionned on dev ML this is now fixed

            People

            • Assignee:
              taher Taher Alkhateeb
              Reporter:
              jacques.le.roux Jacques Le Roux
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development