You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Attila Doroszlai (Jira)" <ji...@apache.org> on 2020/04/30 10:48:00 UTC

[jira] [Created] (RATIS-915) Improve output of tests

Attila Doroszlai created RATIS-915:
--------------------------------------

             Summary: Improve output of tests
                 Key: RATIS-915
                 URL: https://issues.apache.org/jira/browse/RATIS-915
             Project: Ratis
          Issue Type: Improvement
          Components: test
            Reporter: Attila Doroszlai
            Assignee: Attila Doroszlai


I would like to propose the following improvements for unit tests:

# include stack trace for test failures in results
# include thread name in log message format

Example for stack trace:

{code}
-------------------------------------------------------------------------------
Test set: org.apache.ratis.server.simulation.TestRaftSnapshotWithSimulatedRpc
-------------------------------------------------------------------------------
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.468 s <<< FAILURE! - in org.apache.ratis.server.simulation.TestRaftSnapshotWithSimulatedRpc
testBasicInstallSnapshot(org.apache.ratis.server.simulation.TestRaftSnapshotWithSimulatedRpc)  Time elapsed: 1.676 s  <<< FAILURE!
java.lang.AssertionError
	at org.junit.Assert.fail(Assert.java:86)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at org.junit.Assert.assertTrue(Assert.java:52)
	at org.apache.ratis.statemachine.RaftSnapshotBaseTest.verifyTakeSnapshotMetric(RaftSnapshotBaseTest.java:261)
	at org.apache.ratis.statemachine.RaftSnapshotBaseTest.testBasicInstallSnapshot(RaftSnapshotBaseTest.java:240)
	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:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	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.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:748)
{code}

For example without stack trace see RATIS-889.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)