From: <tho...@us...> - 2013-02-08 16:17:56
|
Revision: 6896 http://bigdata.svn.sourceforge.net/bigdata/?rev=6896&view=rev Author: thompsonbry Date: 2013-02-08 16:17:49 +0000 (Fri, 08 Feb 2013) Log Message: ----------- Fixed bug in awaitCondition() where it would only wait for an AssertionFailedError but not a TimeoutException. It now waits up to the timeout for anything. Added in code for handling the quorum break to HAJournalServer. Added HA2 test suite into CI. Modified Paths: -------------- branches/READ_CACHE/bigdata/src/test/com/bigdata/io/TestCase3.java branches/READ_CACHE/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/READ_CACHE/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java Modified: branches/READ_CACHE/bigdata/src/test/com/bigdata/io/TestCase3.java =================================================================== --- branches/READ_CACHE/bigdata/src/test/com/bigdata/io/TestCase3.java 2013-02-08 15:37:38 UTC (rev 6895) +++ branches/READ_CACHE/bigdata/src/test/com/bigdata/io/TestCase3.java 2013-02-08 16:17:49 UTC (rev 6896) @@ -30,13 +30,13 @@ import java.nio.ByteBuffer; import java.util.concurrent.TimeUnit; -import com.bigdata.btree.BytesUtil; -import com.bigdata.journal.TestHelper; - import junit.framework.AssertionFailedError; import junit.framework.TestCase; import junit.framework.TestCase2; +import com.bigdata.btree.BytesUtil; +import com.bigdata.journal.TestHelper; + /** * Base class for some <code>assertEquals</code> methods not covered by * {@link TestCase} or {@link TestCase2}. @@ -204,11 +204,14 @@ cond.run(); // success. return; - } catch (final AssertionFailedError e) { + } catch (final Throwable e) { +// final boolean interesting = // +// InnerCause.isInnerCause(e, AssertionFailedError.class) || // +// InnerCause.isInnerCause(e, TimeoutException.class); remaining = nanos - (System.nanoTime() - begin); if (remaining < 0) { // Timeout - rethrow the failed assertion. - throw e; + throw new RuntimeException(e); } // Sleep up to 10ms or the remaining nanos, which ever is less. final int millis = (int) Math.min( @@ -225,7 +228,7 @@ remaining = nanos - (System.nanoTime() - begin); if (remaining < 0) { // Timeout - rethrow the failed assertion. - throw e; + throw new RuntimeException(e); } } } Modified: branches/READ_CACHE/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java =================================================================== --- branches/READ_CACHE/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2013-02-08 15:37:38 UTC (rev 6895) +++ branches/READ_CACHE/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2013-02-08 16:17:49 UTC (rev 6896) @@ -824,19 +824,19 @@ } - // if (server.isRunning()) { - // /* - // * Attempt to cast a vote for our lastCommitTime. - // * - // * FIXME BOUNCE : May need to trigger when we re-connect with - // * zookeeper if this event was triggered by a zk session - // * expiration. - // */ - // doConditionalCastVote(server, - // (Quorum<HAGlue, QuorumService<HAGlue>>) this - // .getQuorum(), - // journal); - // } + if (server.isRunning()) { + /* + * Attempt to cast a vote for our lastCommitTime. + * + * FIXME BOUNCE : May need to trigger when we re-connect + * with zookeeper if this event was triggered by a zk + * session expiration. + */ + doConditionalCastVote( + server, + (Quorum<HAGlue, QuorumService<HAGlue>>) getQuorum(), + journal); + } // Done. return null; Modified: branches/READ_CACHE/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java =================================================================== --- branches/READ_CACHE/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java 2013-02-08 15:37:38 UTC (rev 6895) +++ branches/READ_CACHE/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestAll.java 2013-02-08 16:17:49 UTC (rev 6896) @@ -86,7 +86,7 @@ // HA2 test suite (k=3, but only 2 services are running). // FIXME (***) Enable TestHA2JournalServer in CI (debug bounce leader/follower first). - //suite.addTestSuite(TestHA2JournalServer.class); + suite.addTestSuite(TestHA2JournalServer.class); // HA3 test suite. suite.addTestSuite(TestHA3JournalServer.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |