ctf: Fix slow test due to expected timeout
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tue, 2 Feb 2016 22:56:50 +0000 (17:56 -0500)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tue, 2 Feb 2016 23:30:08 +0000 (18:30 -0500)
The test was looking for a possible checkbox (in 4.6) but when it
it was not there (4.5) it had to wait 50 secs for it to time out.
Instead we can set a very short timeout because it will instantly
either be there or not.

Change-Id: I05acf8844619377362accd32af7d994e050d5ec6
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/65747
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Hudson CI
ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/META-INF/MANIFEST.MF
ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/StandardImportAndReadSmokeTest.java

index 078b84bd12cddb912247f69e4a70caa270338358..27f6e4acc8c239e55f9db4f572201dc795dab124 100644 (file)
@@ -27,6 +27,7 @@ Import-Package: org.apache.log4j,
  org.eclipse.swtbot.swt.finder.exceptions,
  org.eclipse.swtbot.swt.finder.finders,
  org.eclipse.swtbot.swt.finder.junit,
+ org.eclipse.swtbot.swt.finder.matchers,
  org.eclipse.swtbot.swt.finder.results,
  org.eclipse.swtbot.swt.finder.utils,
  org.eclipse.swtbot.swt.finder.waits,
index 8aabb21db37d62e49ac8627dc6ec8c1b7b8a4c4f..63e8406cb8171180a46ddf90b2de6d214d76e448 100644 (file)
@@ -13,6 +13,7 @@
 
 package org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests;
 
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withLabel;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -40,7 +41,6 @@ import org.eclipse.core.runtime.URIUtil;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
 import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
 import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
 import org.eclipse.swtbot.swt.finder.results.VoidResult;
@@ -54,6 +54,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
 import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace.ImportTraceWizard;
 import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace.ImportTraceWizardPage;
 import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace.Messages;
@@ -521,8 +522,10 @@ public class StandardImportAndReadSmokeTest extends AbstractImportAndReadSmokeTe
         fBot.button("Next >").click();
         fBot.button("&Deselect All").click();
         try {
-            fBot.checkBox("Resolve and export linked resources").select();
-        } catch (WidgetNotFoundException e) {
+            String resolveLinkedResLabel = "Resolve and export linked resources";
+            fBot.waitUntil(Conditions.waitForWidget(withLabel(resolveLinkedResLabel)), 100);
+            fBot.checkBox(resolveLinkedResLabel).select();
+        } catch (TimeoutException e) {
             // Ignore, doesn't exist pre-4.6M5
         }
 
This page took 0.026086 seconds and 5 git commands to generate.