diff options
author | Thomas Watson | 2020-05-21 16:03:12 +0000 |
---|---|---|
committer | Thomas Watson | 2020-05-21 16:03:12 +0000 |
commit | 3171fc3fd4c427273526616f17f5724eb6bfee52 (patch) | |
tree | d4b0790f8dd4790013b79433ececb308dd9700f2 | |
parent | b744056353e7d54dba04b35b7855f253685df288 (diff) | |
download | rt.equinox.framework-I20200526-0600.tar.gz rt.equinox.framework-I20200526-0600.tar.xz rt.equinox.framework-I20200526-0600.zip |
Bug 563372 - Capture thread dump for timeout during updateY20200528-0030S4_16_0_RC1I20200528-0200I20200528-0000I20200527-1800I20200527-0600I20200526-1800I20200526-0600I20200525-1800I20200525-0640I20200524-1800I20200524-0850I20200524-0600I20200524-0220I20200523-1800I20200523-0600I20200522-1800
Change-Id: I96f1ef0e85ab873f56c612ff6e0d509bfd50a640
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
2 files changed, 15 insertions, 3 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java index 2d278ee44..ab849d154 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java @@ -311,8 +311,7 @@ public class AbstractBundleTests extends CoreTest { static public FrameworkEvent stop(Framework equinox, boolean quietly, long timeout) { if (equinox == null) return null; - BundleContext bc = equinox.getBundleContext(); - final String uuid = bc == null ? null : bc.getProperty(Constants.FRAMEWORK_UUID); + final String uuid = getUUID(equinox); try { equinox.stop(); } catch (BundleException e) { @@ -320,6 +319,10 @@ public class AbstractBundleTests extends CoreTest { fail("Unexpected erorr stopping framework", e); //$NON-NLS-1$ } } + return waitForStop(equinox, uuid, quietly, timeout); + } + + static public FrameworkEvent waitForStop(Framework equinox, String uuid, boolean quietly, long timeout) { try { FrameworkEvent stopEvent = equinox.waitForStop(timeout); if (stopEvent.getType() == FrameworkEvent.WAIT_TIMEDOUT) { @@ -342,6 +345,11 @@ public class AbstractBundleTests extends CoreTest { return null; } + public static String getUUID(Framework equinox) { + BundleContext bc = equinox.getBundleContext(); + return bc == null ? null : bc.getProperty(Constants.FRAMEWORK_UUID); + } + static private String getState(Framework framework) { int state = framework.getState(); switch (state) { diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java index 61aa581ff..83b9f3429 100755 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java @@ -1623,13 +1623,17 @@ public class SystemBundleTests extends AbstractBundleTests { equinox.start(); assertEquals("Unexpected state", Bundle.ACTIVE, testTCCL.getState()); //$NON-NLS-1$ + String uuid = getUUID(equinox); // test that the correct tccl is used for framework update try { equinox.update(); - checkActive(testTCCL); } catch (Exception e) { fail("Unexpected exception", e); //$NON-NLS-1$ } + waitForStop(equinox, uuid, false, 10000); + + checkActive(testTCCL); + systemContext = equinox.getBundleContext(); assertEquals("Unexpected state", Bundle.ACTIVE, testTCCL.getState()); //$NON-NLS-1$ |