From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31402 invoked by alias); 25 Sep 2004 08:30:23 -0000 Mailing-List: contact mauve-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-discuss-owner@sources.redhat.com Received: (qmail 31393 invoked from network); 25 Sep 2004 08:30:21 -0000 Received: from unknown (HELO johanna.resare.com) (193.14.119.138) by sourceware.org with SMTP; 25 Sep 2004 08:30:21 -0000 Received: from molly.resare.com (c-2f1f72d5.01-60-6c6b701.cust.bredbandsbolaget.se [213.114.31.47]) by johanna.resare.com (Postfix) with ESMTP id 7D460D6DDA for ; Sat, 25 Sep 2004 10:29:22 +0200 (CEST) Received: from [192.168.110.42] (marit [192.168.110.42]) by molly.resare.com (Postfix) with ESMTP id 7306ED33B7 for ; Sat, 25 Sep 2004 10:30:20 +0200 (CEST) Subject: [PATCH] Thread.contextClassLoader test make unsafe timing assumption From: Noa Resare To: mauve-discuss@sources.redhat.com Content-Type: multipart/mixed; boundary="=-UYTb45Lufztvk486FHW0" Date: Sat, 25 Sep 2004 08:30:00 -0000 Message-Id: <1096101019.15409.16.camel@localhost.localdomain> Mime-Version: 1.0 X-SW-Source: 2004-q3/txt/msg00027.txt.bz2 --=-UYTb45Lufztvk486FHW0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 516 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 --=-UYTb45Lufztvk486FHW0 Content-Disposition: attachment; filename=mauve-threadfix.patch Content-Type: text/x-patch; name=mauve-threadfix.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 1391 ? 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 + + * gnu/testlet/java/lang/Thread/contextClassLoader.java: + Wait for test threads to finish before continuing. + 2004-09-23 David Daney * 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 { --=-UYTb45Lufztvk486FHW0--