Skip to content

Commit 0fc9046

Browse files
committed
Fix recurring test failure in PlatformUITest#testCreateAndRunWorkbench #1517
The RCPTestWorkbenchAdvisor uses static fields to track the state of startup operations. These fields were not reset between test runs. If PlatformUITest.testCreateAndRunWorkbench is run multiple times (e.g. in a suite or during repeated test execution), the 'started' flag would remain 'true' from the previous run, causing assertions in subsequent runs to fail (as operations would incorrectly report running after startup). This change resets 'started' and the result flags to their initial state in preStartup().
1 parent e15e9bf commit 0fc9046

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/RCPTestWorkbenchAdvisor.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ public void eventLoopIdle(final Display display) {
127127

128128
@Override
129129
public void preStartup() {
130+
synchronized (RCPTestWorkbenchAdvisor.class) {
131+
started = false;
132+
}
133+
asyncDuringStartup = null;
134+
syncWithDisplayAccess = null;
135+
asyncWithDisplayAccess = null;
136+
syncWithoutDisplayAccess = null;
137+
asyncWithoutDisplayAccess = null;
138+
130139
super.preStartup();
131140
final Display display = Display.getCurrent();
132141

0 commit comments

Comments
 (0)