JUnit looks like it's including the time taken to perform @BeforeClass @Before when it reports my test timing.
I'm using JUnit 4.12
In this case it shows 23.863 seconds against the test and 25.649 total. When I manually instrument all the methods, this is the breakdown:
10:11:20.074 [INFO] [mainId] beforeClass completed in 12516ms
10:11:40.083 [INFO] [mainId] beforeTest completed in 20009ms
10:11:44.171 [INFO] [mainId] start_test completed in 4076ms
So if I add beforeTest and start_test timing I get close to the time reported in the UI.
- Is there a way to tell JUnit to only display the start_test time?
Right now I just manually output the timing like in this post: https://stackoverflow.com/a/180191/1165140
UPDATE 2017-07-27 Actually problem is with before test methods (@Before) not @BeforeClass as I previously thought - error in my logging. Still in my view it should be configurable whether this time is included. I'm using @beforetest to setup data before each test.
I've confirmed that the inflated time is outputted in the UI as well as the maven surefire XML output from the command line.