Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E8CCD10101 for ; Thu, 26 Sep 2013 20:06:41 +0000 (UTC) Received: (qmail 26392 invoked by uid 500); 26 Sep 2013 20:06:34 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 25733 invoked by uid 500); 26 Sep 2013 20:06:30 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 25696 invoked by uid 99); 26 Sep 2013 20:06:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Sep 2013 20:06:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Sep 2013 20:06:27 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3AC4623888E4; Thu, 26 Sep 2013 20:06:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1526664 - in /db/derby/code/branches/10.10: ./ java/testing/org/apache/derbyTesting/functionTests/tests/store/IndexSplitDeadlockTest.java Date: Thu, 26 Sep 2013 20:06:07 -0000 To: derby-commits@db.apache.org From: kmarsden@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130926200607.3AC4623888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kmarsden Date: Thu Sep 26 20:06:06 2013 New Revision: 1526664 URL: http://svn.apache.org/r1526664 Log: DERBY-6146 testMultipleLastKeyWaitsInMaxScan(org.apache.derbyTesting.functionTests.tests.store.IndexSplitDeadlockTest)junit.framework.AssertionFailedError: Column value mismatch @ column '1', merge revision 1526569 from trunk Modified: db/derby/code/branches/10.10/ (props changed) db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/store/IndexSplitDeadlockTest.java Propchange: db/derby/code/branches/10.10/ ------------------------------------------------------------------------------ Merged /db/derby/code/trunk:r1526569 Modified: db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/store/IndexSplitDeadlockTest.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/store/IndexSplitDeadlockTest.java?rev=1526664&r1=1526663&r2=1526664&view=diff ============================================================================== --- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/store/IndexSplitDeadlockTest.java (original) +++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/store/IndexSplitDeadlockTest.java Thu Sep 26 20:06:06 2013 @@ -649,9 +649,14 @@ public class IndexSplitDeadlockTest exte }); // Give the other thread a little while to start and obtain the - // lock on the last record. - Thread.sleep(1000); - + // lock on the last record. We expect two locks in the lock table + // when the other thread is ready. Don't wait more than a minute + // as something must have gone wrong. + int totalWait = 0; + do { + totalWait += 500; + Thread.sleep(500); + } while (numlocks() < 2 && totalWait < 60000); // The last record should be locked now, so this call will have to // wait initially. This statement used to cause an assert failure in // debug builds before DERBY-4193. @@ -662,6 +667,20 @@ public class IndexSplitDeadlockTest exte } /** + * Get the number of locks in the lock table + * @return number of locks + * @throws SQLException + */ + private int numlocks() throws SQLException { + Statement s = createStatement(); + ResultSet rs = s.executeQuery("SELECT count(*) from syscs_diag.lock_table"); + rs.next(); + int num = rs.getInt(1); + rs.close(); + return num; + } + + /** * Test that a forward scan works even in the case that it has to wait * for the previous key lock more than once. This used to cause an assert * failure in sane builds before DERBY-4193.