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

Test java/awt/EventQueue/NonComponentSourcePost.java is unstable

XMLWordPrintable

    • b07
    • generic
    • generic

        This test fails time to time in the mach5.

        The test in question posts a number of events to the EventQueue and
        checks that all events are dispatched. But it had incorrect assumption
        that "while(q.peekEvent()!=null)" guarantees that all events were dispatched.

        In some rare cases, it is possible that peekEvent () returns null because
        the last event was removed from the queue, but this event was not necessarily
        dispatched at that moment.

        An updated test now uses "CountDownLatch" for proper synchronization and the
        test is moved to the open repo.

        PS: I have added "Toolkit.getDefaultToolkit().getSystemEventQueue().push(q)" otherwise
        the test hang when executed via command line.

              serb Sergey Bylokhov
              serb Sergey Bylokhov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: