Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8251020

*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message

    Details

    • Subcomponent:
      svc
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      A DESCRIPTION OF THE PROBLEM :
      This was supposedly fixed in JAVA 8. But i discovered this error on java 8

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Write junit for a thread with sleep written inside it

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No error should be shown
      ACTUAL -
      Class transformation time: 1.298022943s for 2405 classes or 5.397184794178794E-4s per class
      *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
      *** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844

      Process finished with exit code 0

      ---------- BEGIN SOURCE ----------
      class A {
      protected void func() {

       Thread runEmergencyModeThread = new Thread() {
                  public void run() {
      mServiceWait = true;

                      int timeOutCount = 0;
      while (mServiceWait) {
                          try {
                              if (proccessedPackages < 125) {
                                  proccessedPackages += 1;
                                  if (proccessedPackages % 5 == 0) {
                                      updateProgress(); //this line never executed
                                  }
                              }
                              timeOutCount++;
                              if (timeOutCount > 300) {
                                  Elog.v(TAG, "runApplicationOperation - mServiceWait timeout");
                                  setServiceWait(false); // timeout 90 secs
                              }
                              sleep(300);//This is the last line to be executed
                          } catch (InterruptedException e) {
                              e.printStackTrace();
                          }
                      }
      }
      Thread.start();
      }
      }
      }
      @test
       void functest(){
       A testClass=new A();
       A spyclass=spy(testclass);
       spyclass.func();
       verify(spyclass,times(1)).func();
       }


      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The test passes but error is thrown

        Attachments

          Activity

            People

            • Assignee:
              sswsharm swati sharma
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: