By default, IdeaTestCase runs tests on the AWT event thread while holding a write lock. This is convenient in most cases, but not always desirable. If you need to enqueue events onto the AWT thread and wait for them to execute (like when testing compilation), this can be a problem.
Due to lack of documentation for IdeaTestCase, as well as some assumptions that IdeaTestCase's setUp and tearDown methods make, it can be difficult to figure out how to avoid running on the event thread.
So, here's a test that runs on the JUnit thread, leaving the AWT event thread free for enqueuing and executing runnables. Thanks to Eugene Vigordchik for the tip.