public class TestSingletonQuorumSemantics extends AbstractQuorumTestCase
TestCase2.MyProperties, TestCase2.RandomType
actors, clients, fixture, k, quorums
_randomType, log
Constructor and Description |
---|
TestSingletonQuorumSemantics() |
TestSingletonQuorumSemantics(String name) |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Runs a specific unit test a bunch of times looking for instances where
the test does not run within the target time period.
|
protected void |
setUp() |
void |
test_awaitQuorum()
Unit test of timeout in
Quorum.awaitQuorum(long, TimeUnit) . |
void |
test_memberAdd_terminateClient()
Unit test for quorum member add followed by the termination of the quorum
client.
|
void |
test_memberAddRemove()
Unit test for quorum member add/remove.
|
void |
test_pipelineAddRemove()
Unit test for write pipeline add/remove.
|
void |
test_serviceJoin_terminateClient()
Unit test verifying that we clear down the quorum's reflection of the
distributed quorum state where we first have a quorum meet and then
terminate the quorum client.
|
void |
test_serviceJoin()
Unit test for the protocol up to a service join, which triggers a leader
election.
|
void |
test_voting()
Unit test for the voting protocol for a singleton quorum.
|
void |
testQuorumTransitions()
Check all valid quorum transitions with:
currentToken,
nextToken,
isJoined state
haReady token.
|
assertCondition, tearDown, toString
assertCondition, assertEquals, assertEquals, getBytes, getPort, getRandomData, getRandomData
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getProperties, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
public TestSingletonQuorumSemantics()
public TestSingletonQuorumSemantics(String name)
name
- protected void setUp() throws Exception
setUp
in class AbstractQuorumTestCase
Exception
public void test_memberAddRemove() throws InterruptedException
InterruptedException
public void test_memberAdd_terminateClient() throws InterruptedException
InterruptedException
public void test_pipelineAddRemove() throws InterruptedException
InterruptedException
public static void main(String[] args) throws Exception
Exception
test_voting()
public void test_voting() throws InterruptedException, AsynchronousQuorumCloseException, TimeoutException
The test terminates when the fixture tears down the AbstractQuorum's internal watcher action service, which has a hung action. If the WatcherActionService is also single-threaded, then this could clearly lead to a deadlock since there would be no thread available to handle new events.
It is awaiting the quorumBreak condition in AbstractQuorumActor.clearToken(). This issue may be that we have two distinct signals for quorumBreak versus quorumMeet which need to be combined and then the various methods modified to also test the condition variable. [I've made that change.]
It seems likely that either a concurrent watcherActionService -or- a finite timeout would get the unit tests to pass. However, only the former would work around a deadlock due to a stuck Condition.
Look again at what Condition is getting stuck and at the stress test in
main(String[])
for causes. [nhang=17, nerr=0, nrun=1000]. There
are several different causes, each of which clearly reflects a different
ordering of the events.
It maybe that we see the problem with a singleton quorum because there are no other sources of events to kick the quorum into motion again once it fails to join under the initial impetus.
The problem appears to stem from withdrawing the cast vote before the quorum meets.
public void test_serviceJoin() throws InterruptedException
InterruptedException
public void test_serviceJoin_terminateClient() throws InterruptedException
InterruptedException
public void test_awaitQuorum() throws AsynchronousQuorumCloseException, InterruptedException
Quorum.awaitQuorum(long, TimeUnit)
. and
Quorum.awaitBreak(long, TimeUnit)
.public void testQuorumTransitions()
QuorumTokenTransitions
class.
It should do actual post-condition checks on the public fields of
that class.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.