// Indicates whether we timed out waiting for the invocation to run
@RunsInEDT
private boolean postInvocationEvent(@Nonnull EventQueue eventQueue, long timeout) {
Object lock = new RobotIdleLock();
synchronized (lock) {
eventQueue.postEvent(new InvocationEvent(toolkit, EMPTY_RUNNABLE, lock, true));
long start = currentTimeMillis();
try {
// NOTE: on fast linux systems when showing a dialog, if we don't provide a timeout, we're never notified, and
// the test will wait forever (up through 1.5.0_05).
lock.wait(timeout);