ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vyacheslav Daradur <daradu...@gmail.com>
Subject Re: Unreliable checks in tests for string presence in GridStringLogger contents
Date Wed, 23 May 2018 09:41:12 GMT
Hi, Andrey, I have faced this problem too.

I'd suggest introducing new logger for tests instead of extending API
of *GridStringLogger*.

The new logger should be some kind of *listened*, for example with the
folowing API:

void addListener(String pattern, CountDownLatch latch);
void addListener(IgniteInClosure<String> lsnr);

This approach reduces memory load in comparison with *GridStringLogger*.

Just for example these should demonstrate my idea, *listened logger* -
[1], *listener* - [2]:

[1] https://github.com/apache/ignite/blob/master/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/logger/ListenedGridTestLog4jLogger.java
[2] https://github.com/apache/ignite/blob/master/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/junits/IgniteCompatibilityAbstractTest.java#L304

On Wed, May 23, 2018 at 11:46 AM, Andrey Kuznetsov <stkuzma@gmail.com> wrote:
> Folks,
>
> While testing my PR on TeamCity I found a floating test failure. Sometimes
> we use {{GridStringLogger}} test facility to capture Ignite node logs and
> then check whether some marker strings exist in log output. Since logger's
> buffer is limited (32K chars by default) unrelated changes that add more
> logging can damage a test.
>
> I propose to add some stuff to {{GridStringLogger}} in order to catch
> preset marker strings during logging, then we will not depend on buffer
> size.
>
> Thoughts?
>
> --
> Best regards,
>   Andrey Kuznetsov.



-- 
Best Regards, Vyacheslav D.

Mime
View raw message