* [PATCH] Thread.contextClassLoader test make unsafe timing assumption
@ 2004-09-25 8:30 Noa Resare
0 siblings, 0 replies; only message in thread
From: Noa Resare @ 2004-09-25 8:30 UTC (permalink / raw)
To: mauve-discuss
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
While trying to track down some intermittent test failures in recent
kaffe I found a problem in
gnu/testlet/java/lang/Thread/contextClassLoader.java. When testing that
context class loaders gets inherited correctly the mauve test assumes
that the first thread will complete before the data is set up for the
next one. When new thread execution for some reason is slow the test
will sometimes fail.
The attached patch solves the problem by waiting for the first thread to
finish before the next one is set up.
/noa
[-- Attachment #2: mauve-threadfix.patch --]
[-- Type: text/x-patch, Size: 1391 bytes --]
? mauve-threadfix.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/mauve/mauve/ChangeLog,v
retrieving revision 1.675
diff -u -r1.675 ChangeLog
--- ChangeLog 23 Sep 2004 20:11:27 -0000 1.675
+++ ChangeLog 25 Sep 2004 08:23:19 -0000
@@ -1,3 +1,8 @@
+2004-09-25 Noa Resare <noa@resare.com>
+
+ * gnu/testlet/java/lang/Thread/contextClassLoader.java:
+ Wait for test threads to finish before continuing.
+
2004-09-23 David Daney <ddaney@avtrex.com>
* gnu/testlet/java/net/URL/URLTest.java: Add tests for getUserInfo().
Index: gnu/testlet/java/lang/Thread/contextClassLoader.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Thread/contextClassLoader.java,v
retrieving revision 1.2
diff -u -r1.2 contextClassLoader.java
--- gnu/testlet/java/lang/Thread/contextClassLoader.java 12 Apr 2004 11:44:39 -0000 1.2
+++ gnu/testlet/java/lang/Thread/contextClassLoader.java 25 Sep 2004 08:23:29 -0000
@@ -51,6 +51,7 @@
checkClassLoader = t_cl;
check_msg = "Run with default contextClassLoader";
t.start();
+ t.join();
current.setContextClassLoader(null);
harness.check(current.getContextClassLoader() == null,
@@ -62,6 +63,7 @@
checkClassLoader = null;
check_msg = "run with null classloader";
t.start();
+ t.join();
}
finally
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-09-25 8:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-25 8:30 [PATCH] Thread.contextClassLoader test make unsafe timing assumption Noa Resare
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).