[SERVER-78853] In unit test results asserts counter is always zero Created: 11/Jul/23  Updated: 02/Feb/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Ivan Fefer Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Build
Operating System: ALL
Participants:

 Description   

In the output of tests results there is asserts field: 

{"t":{"$date":"2023-07-11T09:56:47.744Z"},"s":"I",  "c":"TEST",     "id":23065,   "ctx":"main","msg":"Totals","attr":{"totals":{"name":"TOTALS","tests":1040,"fails":0,"asserts":0,"time":{"durationMillis":150001},"failures":[]}}} 

It is always zero.
We can see in unittest.cpp that it is never incremented.

We should either remove it or fix it.



 Comments   
Comment by Ivan Fefer [ 18/Jul/23 ]

How to reproduce:

  • Compile any unittest. For example, 

    ninja -j 100 build/install/bin/db_pipeline_test

  • Run the unittest

    ./build/install/bin/db_pipeline_test

  • Second to last line of the output have total counters

{"t":{"$date":"2023-07-17T12:11:11.879Z"},"s":"I",  "c":"TEST",     "id":23065,   "ctx":"main","msg":"Totals","attr":{"totals":{"name":"TOTALS","tests":3067,"fails":0,"asserts":0,"time":{"durationMillis":102211},"failures":[]}}} 

  • Note "asserts": 0 value - it is always zero.
  • Expected this value to have total number of asserts in tests.

This value might be useful if you are adding a new test and it passes, so you can see that the test actually checks something. But it is fine to just delete it as well.

 

Comment by Steve Gross [ 17/Jul/23 ]

ivan.fefer@mongodb.com We've added this to our "quick wins" epic for next quarter. In the meantime, can you steps-to-reproduce?

Generated at Thu Feb 08 06:39:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.