OpenSearch/plugins/transport-nio
Andrew Ross 96d55966a2
Use try-with-resources with MockLogAppender (#1595)
I previously added a helper that started a MockLogAppender to ensure it
was never added to a Logger before it was started. I subsequently found
the opposite case in RolloverIT.java where the appender was stopped
before it was closed, therefore creating a race where a concurrently
running test in the same JVM could cause a logging failure. This seems
like a really easy mistake to make when writing a test or introduce when
refactoring a test. I've made a change to use try-with-resources to
ensure that proper setup and teardown is done. This should make it much
harder to introduce this particular test bug in the future.
Unfortunately, it did involve touching a lot of files. The changes here
are purely structural to leverage try-with-resources; no testing logic
has been changed.

Signed-off-by: Andrew Ross <andrross@amazon.com>
2021-12-21 15:00:55 -06:00
..
licenses Upgrading netty version to 4.1.69.Final (#1363) 2021-10-18 17:30:19 -04:00
src Use try-with-resources with MockLogAppender (#1595) 2021-12-21 15:00:55 -06:00
build.gradle Upgrading netty version to 4.1.69.Final (#1363) 2021-10-18 17:30:19 -04:00