[ 
https://issues.apache.org/jira/browse/SLING-5243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14987220#comment-14987220
 ] 

Stefan Egli commented on SLING-5243:
------------------------------------

the problem in this case is that during an {{analyzeVotings}} the test is 
reading an {{/ongoingVotings}} resource in a non-consistent (transactionally 
impossible) state: it looks like during creation of a new vote, the voting 
handler is already seeing the changes - but only partially. That results in 
{{voting.matchesLiveView}} to return false even though the voting hasn't been 
fully created yet - which is then interpreted as: ok, I have to vote no. That 
is wrong at that point, cos you shouldn't vote on a voting-in-creation. 
However, that is never possible in real-life, it must be due to the way the 
testing is setup.
The relevant part in the log file:
{code}
02.11.2015 15:25:00.689 *DEBUG* [main] HeartbeatHandler: doCheckViewWith: no 
pending nor winning votes. But: view does not match established or no 
established yet. Initiating a new voting
02.11.2015 15:25:00.689 *DEBUG* [main] HeartbeatHandler: doCheckViewWith: one 
of the live instances is: 3e5791c1-31c7-4831-af73-843e5e15e478
02.11.2015 15:25:00.689 *INFO * [main] MockedResourceResolver: create: creating 
of ongoingVotings under MockedResource, type=nt:unstructured, 
path=/var/discovery/impl was successful=true
02.11.2015 15:25:00.696 *INFO * [main] MockedResourceResolver: create: creating 
of d7ac3d95-6dda-448c-8759-888284717588 under MockedResource, 
type=nt:unstructured, path=/var/discovery/impl/ongoin
gVotings was successful=true
[...]
02.11.2015 15:25:00.705 *DEBUG* [VotingEventListener-standaloneInstance] 
VotingHelper: listVotings: votings found: 1
02.11.2015 15:25:00.705 *DEBUG* [VotingEventListener-standaloneInstance] 
VotingView: getVotingStartTime: got a voting without votingStart. Likely in 
creation: MockedResource, type=nt:unstructured
, path=/var/discovery/impl/ongoingVotings/d7ac3d95-6dda-448c-8759-888284717588
02.11.2015 15:25:00.705 *INFO * [VotingEventListener-standaloneInstance] 
3e5791c1-31c7-4831-af73-843e5e15e478: analyzeVotings: vote doesnt match my live 
view, voting no. comparison result: no mem
bers resource found, vote: a 
VotingView[viewId=d7ac3d95-6dda-448c-8759-888284717588, 
id=d7ac3d95-6dda-448c-8759-888284717588, initiator=null, members=]
[...]
02.11.2015 15:25:00.706 *INFO * [main] MockedResourceResolver: create: creating 
of 3e5791c1-31c7-4831-af73-843e5e15e478 under MockedResource, 
type=nt:unstructured, 
path=/var/discovery/impl/ongoingVotings/d7ac3d95-6dda-448c-8759-888284717588/members
 was successful=true
[...]
02.11.2015 15:25:00.713 *WARN * [main] ItemStateReferenceCache: overwriting 
cached entry 6eab5bf1-34f9-4081-b03a-2ba0fc6ffc37/{}clusterIdDefinedAt
[...]
02.11.2015 15:25:00.715 *INFO * [main] VotingView: newVoting: new voting 
started: newViewId=d7ac3d95-6dda-448c-8759-888284717588, 
resource=MockedResource, type=nt:unstructured, 
path=/var/discovery/impl/ongoingVotings/d7ac3d95-6dda-448c-8759-888284717588, 
#members: 1, members: [3e5791c1-31c7-4831-af73-843e5e15e478]
{code}

> discovery.impl.cluster.SingleInstanceTest.testBootstrap failed on jenkins
> -------------------------------------------------------------------------
>
>                 Key: SLING-5243
>                 URL: https://issues.apache.org/jira/browse/SLING-5243
>             Project: Sling
>          Issue Type: Bug
>    Affects Versions: Discovery Impl 1.1.8
>            Reporter: Stefan Egli
>            Assignee: Stefan Egli
>            Priority: Minor
>             Fix For: Discovery Impl 1.2.2
>
>         Attachments: SingleInstanceTest.testBootstrap.failure1918.full.txt, 
> SingleInstanceTest.testBootstrap.failure1918.txt
>
>
> the following test failed: 
> https://builds.apache.org/job/sling-trunk-1.8/org.apache.sling$org.apache.sling.discovery.impl/1918/testReport/junit/org.apache.sling.discovery.impl.cluster/SingleInstanceTest/testBootstrap/
> {code}
> Error Message
> expected:<1> but was:<0>
> Stacktrace
> java.lang.AssertionError: expected:<1> but was:<0>
>       at org.junit.Assert.fail(Assert.java:88)
>       at org.junit.Assert.failNotEquals(Assert.java:743)
>       at org.junit.Assert.assertEquals(Assert.java:118)
>       at org.junit.Assert.assertEquals(Assert.java:555)
>       at org.junit.Assert.assertEquals(Assert.java:542)
>       at 
> org.apache.sling.discovery.base.its.AbstractSingleInstanceTest.testBootstrap(AbstractSingleInstanceTest.java:284)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:483)
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>       at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>       at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>       at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
>       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
>       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
>       at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to