Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No test logs if TestNG Test has timeout parameter #105

Closed
VolodymyrLykhachov opened this issue Aug 5, 2019 · 6 comments
Closed

No test logs if TestNG Test has timeout parameter #105

VolodymyrLykhachov opened this issue Aug 5, 2019 · 6 comments
Assignees
Milestone

Comments

@VolodymyrLykhachov
Copy link

VolodymyrLykhachov commented Aug 5, 2019

I faced with no logs in RP when I specify timeout parameter in TestNG Test annotation. All events that are relayed to start/stop/methods reflected fine in RP, but no logging from TestNG test that I send through RP appender.
Here is example of @Test annotation
@Test(description = "test", dataProvider = "DataProvider", alwaysRun = true, timeout = 60)

in DEBUG MODE
event.getmessage() has correct message, but
in com.epam.reportportal.service.ReportPortal.emitLog next variable is null

LoggingContext loggingContext = LoggingContext.CONTEXT_THREAD_LOCAL.get();
loggingContext = null

after removing timeout parameter all work well

@VolodymyrLykhachov VolodymyrLykhachov changed the title No logs if TestNG Test has timeout parameter No test logs if TestNG Test has timeout parameter Aug 5, 2019
@dagansandler
Copy link
Contributor

I think this relates to #91

I suggested a (apparently naive) Pull Request at the time, but it was reverted after additional issues appeared:
#53

Perhaps someone can pick this up and find a better solution

@HardNorth HardNorth self-assigned this May 19, 2020
@HardNorth
Copy link
Member

Yes, that's client issue due to ThreadLocal we use in our logging contexts. I believe we need to redesign it, but not in current (v5) version.

@HardNorth
Copy link
Member

As a possible solution we can use InheritedThreadLocal for every Thread, except main. This will probably work for TestNG and JUnit5, since the first one is using main thread only for Suite creation and the second one is not using main thread at all. But what if some frameworks use main thread in the same way as other threads?

@dagansandler
Copy link
Contributor

@HardNorth is there any progress on this? Perhaps this can be parameterized in the client and defaulted to the existing behavior? and frameworks that need this behavior can update to use this setting to solve this issue.

@HardNorth
Copy link
Member

@dagansandler not yet, the issue has milestone 6 since it requires serious logging logic rewrite. Currently I'm working on milestone 5.1, which is related to Android compatibility.

@HardNorth
Copy link
Member

Fixed in #183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants