From 9e377a4313bed2f3ea0b96e9139b4ededb3bc360 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Fri, 15 Aug 2014 15:23:32 +0400 Subject: [PATCH] fix blinking test --- .../com/intellij/psi/impl/DocumentCommitThread.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java b/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java index 76377ef6b98e..8b57843d6b9f 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/DocumentCommitThread.java @@ -554,4 +554,16 @@ public class DocumentCommitThread extends DocumentCommitProcessor implements Run boolean isEnabled() { return myEnabled; } + + @TestOnly + public void waitUntilAllCommitted() throws InterruptedException { + if (!myEnabled) { + throw new IllegalStateException("DocumentCommitThread is disabled"); + } + synchronized (documentsToCommit) { + while(!documentsToCommit.isEmpty()) { + documentsToCommit.wait(); + } + } + } }