You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2015/04/07 11:35:12 UTC

[jira] [Resolved] (OAK-2721) LogDumper rule to dump logs as part of system out in case of test failure

     [ https://issues.apache.org/jira/browse/OAK-2721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chetan Mehrotra resolved OAK-2721.
----------------------------------
    Resolution: Fixed

Done 
* trunk - http://svn.apache.org/r1671773

With this the rule can be used like below

{code}
import import org.apache.jackrabbit.oak.commons.junit.LogDumper;
public class PropertyIndexTest {

    @Rule
    public final LogDumper dumper = new LogDumper();
{code}

Upon any test failure the output would be like below
{noformat}
=============== Logs for [org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexTest#traversalWarning]===================

java.lang.AssertionError
	at org.junit.Assert.fail(Assert.java:92)
	at org.junit.Assert.assertTrue(Assert.java:43)
	at org.junit.Assert.assertTrue(Assert.java:54)
	at org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexTest.traversalWarning(PropertyIndexTest.java:545)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47)
	at org.junit.rules.RunRules.evaluate(RunRules.java:18)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

07.04.2015 12:47:27.972 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing will be performed for following indexes: [/oak:index/nodetype, /oak:index/foo, /oak:index/uuid]
07.04.2015 12:47:28.158 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #10000 /n2992/c0/c1
07.04.2015 12:47:28.279 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #20000 /n353/c0/c1/c2/c3/c4/c5
07.04.2015 12:47:28.383 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #30000 /n4769/c0/c1/c2/c3/c4/c5/c6/c7/c8/c9
07.04.2015 12:47:28.678 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #40000 /n2502/c0/c1
07.04.2015 12:47:28.777 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #50000 /n2865/c0/c1/c2/c3/c4/c5
07.04.2015 12:47:28.863 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #60000 /n2234/c0/c1/c2/c3/c4/c5/c6/c7/c8/c9
07.04.2015 12:47:28.906 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #70000 /n7800/c0/c1
07.04.2015 12:47:28.951 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #80000 /n5096/c0/c1/c2/c3/c4/c5
07.04.2015 12:47:28.987 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #90000 /n5328/c0/c1/c2/c3/c4/c5/c6/c7/c8/c9
07.04.2015 12:47:29.038 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #100000 /n9434/c0/c1/c2/c3/c4/c5/c6/c7
07.04.2015 12:47:29.106 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #110000 /n2036
07.04.2015 12:47:29.173 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #120000 /n6142/c0/c1/c2/c3
07.04.2015 12:47:29.174 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate /oak:index/foo => Indexed 10000 nodes...
07.04.2015 12:47:30.570 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Indexing report
    - /oak:index/nodetype*(1178)
    - /oak:index/foo*(10000)
    - /oak:index/uuid*(0)

07.04.2015 12:47:31.107 *WARN* [main] org.apache.jackrabbit.oak.plugins.index.property.strategy.ContentMirrorStoreStrategy Traversed 10000 nodes using index foo with filter Filter(query=SELECT * FROM [nt:base], path=*)
07.04.2015 12:47:31.126 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing will be performed for following indexes: [/oak:index/nodetype, /oak:index/foo, /oak:index/uuid]
07.04.2015 12:47:31.161 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing Traversed #10000 /n58/c0/c1
07.04.2015 12:47:31.294 *INFO* [main] org.apache.jackrabbit.oak.plugins.index.IndexUpdate Indexing report
    - /oak:index/nodetype*(1178)
    - /oak:index/foo*(100)
    - /oak:index/uuid*(0)

========================================================
{noformat}

> LogDumper rule to dump logs as part of system out in case of test failure
> -------------------------------------------------------------------------
>
>                 Key: OAK-2721
>                 URL: https://issues.apache.org/jira/browse/OAK-2721
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: it
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: 1.2
>
>
> I would like to add a JUnit rule which would dump the logs generated during the execution of a given test in case of a failure. That should help in troubleshooting the test failures on CI
> The impl is modelled on similar impl but for remote logs done in SLING-4280. 



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