public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Noa Resare <noa@resare.com>
To: mauve-discuss@sources.redhat.com
Subject: [PATCH] Thread.contextClassLoader test make unsafe timing assumption
Date: Sat, 25 Sep 2004 08:30:00 -0000	[thread overview]
Message-ID: <1096101019.15409.16.camel@localhost.localdomain> (raw)

[-- 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
       {

                 reply	other threads:[~2004-09-25  8:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1096101019.15409.16.camel@localhost.localdomain \
    --to=noa@resare.com \
    --cc=mauve-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).