From cb5ec0cbe29f16d014a2f56969528eb7f77f1c98 Mon Sep 17 00:00:00 2001 From: dragonmacher <48328597+dragonmacher@users.noreply.github.com> Date: Mon, 7 Dec 2020 12:21:38 -0500 Subject: [PATCH] Tests - Merge test timing fix --- .../propertylist/PropertyListMergeManager2Test.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/propertylist/PropertyListMergeManager2Test.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/propertylist/PropertyListMergeManager2Test.java index d379fe4783..198f43d9e7 100644 --- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/propertylist/PropertyListMergeManager2Test.java +++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/merge/propertylist/PropertyListMergeManager2Test.java @@ -892,6 +892,9 @@ public class PropertyListMergeManager2Test extends AbstractMergeTest { printOpenWindows(); + // 12/87/20 - put in to find intermittent test failure when the button cannot be found + capture(window, "missing.button." + text); + fail("Unable to find radio button '" + text + "'; see console for details"); } @@ -918,6 +921,14 @@ public class PropertyListMergeManager2Test extends AbstractMergeTest { } private AbstractButton findButton(Container container, String text) { + + // note: there may be some timing issue with accessing swing components from the test + // thread. This waitForSwing() will cause registers to get flushed, making swing + // changes visible to this thread. + // + // The correct change would probably be to put this code and the similar code from + // the test framework onto the swing thread when attempting to find swing widgets. + waitForSwing(); Component[] comp = container.getComponents(); for (Component element : comp) { if ((element instanceof AbstractButton && element.isVisible()) &&