8034175: Remove use of UseVMInterruptibleIO from tests
Martin Buchholz
martinrb at google.com
Tue Feb 11 15:52:30 UTC 2014
Thanks for doing this cleanup.
ThrowingTasks fiddles with uncaught exception handlers and security
managers, so should remain otherVM. Interrupt does not, but could use a
tiny bit of cleanup hygiene:
Index: src/test/jtreg/util/concurrent/BlockingQueue/Interrupt.java
===================================================================
RCS file:
/export/home/jsr166/jsr166/jsr166/src/test/jtreg/util/concurrent/BlockingQueue/Interrupt.java,v
retrieving revision 1.3
diff -u -r1.3 Interrupt.java
--- src/test/jtreg/util/concurrent/BlockingQueue/Interrupt.java 27 Sep 2010
19:15:15 -0000 1.3
+++ src/test/jtreg/util/concurrent/BlockingQueue/Interrupt.java 11 Feb 2014
15:47:00 -0000
@@ -25,7 +25,6 @@
* @test
* @bug 6384064
* @summary Check proper handling of interrupts
- * @run main/othervm -XX:-UseVMInterruptibleIO Interrupt
* @author Martin Buchholz
*/
@@ -49,7 +48,8 @@
}
}
- static void checkInterrupted(Iterable<Fun> fs) {
+ static void checkInterrupted(Iterable<Fun> fs)
+ throws InterruptedException {
final Executor immediateExecutor = new Executor() {
public void execute(Runnable r) {
r.run(); }};
@@ -61,6 +61,7 @@
checkInterrupted0(fs, immediateExecutor);
checkInterrupted0(fs, delayedExecutor);
stpe.shutdown();
+ check(stpe.awaitTermination(10, SECONDS));
}
static void testQueue(final BlockingQueue<Object> q) {
@@ -109,8 +110,10 @@
}
checkInterrupted(fs);
} catch (Throwable t) {
- System.out.printf("Failed: %s%n", q.getClass().getSimpleName());
- unexpected(t);
+ System.out.printf("Failed: %s%n",
q.getClass().getSimpleName());
+ unexpected(t);
+ } finally {
+ Thread.interrupted(); // clear interrupts, just in case
}
}
Index: src/test/jtreg/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java
===================================================================
RCS file:
/export/home/jsr166/jsr166/jsr166/src/test/jtreg/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java,v
retrieving revision 1.4
diff -u -r1.4 ThrowingTasks.java
--- src/test/jtreg/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java 10
Jun 2013 17:36:39 -0000 1.4
+++ src/test/jtreg/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java 11
Feb 2014 15:47:00 -0000
@@ -25,7 +25,7 @@
* @test
* @bug 6450200 6450205 6450207 6450211
* @summary Test proper handling of tasks that terminate abruptly
- * @run main/othervm -XX:-UseVMInterruptibleIO ThrowingTasks
+ * @run main/othervm ThrowingTasks
* @author Martin Buchholz
*/
On Tue, Feb 11, 2014 at 3:13 AM, Chris Hegarty <chris.hegarty at oracle.com>wrote:
> On 11 Feb 2014, at 11:10, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> > On 11/02/2014 10:36, Chris Hegarty wrote:
> >> Looks good to me Alan.
> >>
> >> -Chris.
> >>
> > I checked the jsr166 CVS and both of the j.u.concurrent tests also
> specify UseVMInterruptibleIO. I assume Martin will update these.
>
> Yes, I see this too.
>
> Martin,
> Can you please update the 166 CVS as per Alan’s patch?
>
> -Chris.
>
> >
> > -Alan
>
>
More information about the core-libs-dev
mailing list