Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 75664 invoked from network); 30 Apr 2008 12:33:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Apr 2008 12:33:07 -0000 Received: (qmail 5588 invoked by uid 500); 30 Apr 2008 12:33:09 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 5561 invoked by uid 500); 30 Apr 2008 12:33:09 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Delivered-To: moderator for commits@activemq.apache.org Received: (qmail 4045 invoked by uid 99); 30 Apr 2008 12:32:11 -0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r652368 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java test/java/org/apache/activemq/kaha/impl/async/DataFileAppenderTest.java Date: Wed, 30 Apr 2008 12:31:46 -0000 To: commits@activemq.apache.org From: hadrian@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080430123147.0977423889C2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hadrian Date: Wed Apr 30 05:31:46 2008 New Revision: 652368 URL: http://svn.apache.org/viewvc?rev=652368&view=rev Log: Removed timing dependent asserts in test that could cause intermittent failures. Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/impl/async/DataFileAppenderTest.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java?rev=652368&r1=652367&r2=652368&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/DataFileAppender.java Wed Apr 30 05:31:46 2008 @@ -161,10 +161,8 @@ WriteCommand write = new WriteCommand(location, data, sync); // Locate datafile and enqueue into the executor in sychronized block so - // that - // writes get equeued onto the executor in order that they were assigned - // by - // the data manager (which is basically just appending) + // that writes get equeued onto the executor in order that they were assigned + // by the data manager (which is basically just appending) synchronized (this) { // Find the position where this item will land at. @@ -197,10 +195,8 @@ WriteCommand write = new WriteCommand(location, data, onComplete); // Locate datafile and enqueue into the executor in sychronized block so - // that - // writes get equeued onto the executor in order that they were assigned - // by - // the data manager (which is basically just appending) + // that writes get equeued onto the executor in order that they were assigned + // by the data manager (which is basically just appending) synchronized (this) { // Find the position where this item will land at. Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/impl/async/DataFileAppenderTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/impl/async/DataFileAppenderTest.java?rev=652368&r1=652367&r2=652368&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/impl/async/DataFileAppenderTest.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/impl/async/DataFileAppenderTest.java Wed Apr 30 05:31:46 2008 @@ -66,7 +66,8 @@ for (int i=0; i= iterations); + // at this point most probably dataManager.getInflightWrites().size() >= 0 + // as the Thread created in DataFileAppender.enqueue() may not have caught up. Thread.sleep(1000); assertTrue("queued data is written", dataManager.getInflightWrites().isEmpty()); } @@ -76,15 +77,15 @@ final int iterations = 10; final CountDownLatch latch = new CountDownLatch(iterations); ByteSequence data = new ByteSequence("DATA".getBytes()); - for (int i=0; i= iterations); - assertEquals("none written", iterations, latch.getCount()); + // at this point most probably dataManager.getInflightWrites().size() >= 0 + // as the Thread created in DataFileAppender.enqueue() may not have caught up. Thread.sleep(1000); assertTrue("queued data is written", dataManager.getInflightWrites().isEmpty()); assertEquals("none written", 0, latch.getCount());