Gaffer icon indicating copy to clipboard operation
Gaffer copied to clipboard

Improve testing to reduce unnecessary console output

Open GCHQDeveloper314 opened this issue 2 years ago • 4 comments

Certain tests produce an excessive amount of output. This includes:

  • Unnecessary stack traces caused by expected exceptions which are part of testing
  • A very large verbose output from mockito which fills up 10+ terminal screens
  • Repeated output of banner/startup messages for integration tests (such as Spring)

The above was noticed while checking test output for any changes related to the Log4j migration. We don't have automated logging testing and this cannot be introduced until test output is predictable and quieter.

GCHQDeveloper314 avatar Mar 25 '22 08:03 GCHQDeveloper314

In #2786 @GCHQDeveloper314 said: "A repeated warning of core.singletons.SingletonReservation WARN - An Accumulo Client was garbage collected without being closed is responsible for the vast majority of this excessive size. This originates in MiniAccumuloStore.getConnection and should ideally be fixed... This relates to (gh2619), in as much as it tackles the symptoms of one of the issues listed there. A proper fix for the MiniAccumuloStore should be explored there."

n3101 avatar Oct 25 '22 07:10 n3101

To clarify, the other PR suppressed the garbage collection warning, it did not fix the cause. This issue would include fixing the root cause of that error and then removing the logging configuration which was suppressing it.

This would be in addition to the other sources/causes of excess output given above and any others found when working on this issue.

GCHQDeveloper314 avatar Jul 04 '23 09:07 GCHQDeveloper314

The repeated Spring banners can be disabled - see Spring docs.

GCHQDeveloper314 avatar Aug 10 '23 12:08 GCHQDeveloper314