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

luatest: mixing of stdout and stderr has bad consequences #392

Closed
Totktonada opened this issue May 29, 2023 · 0 comments · Fixed by #394
Closed

luatest: mixing of stdout and stderr has bad consequences #392

Totktonada opened this issue May 29, 2023 · 0 comments · Fixed by #394
Labels
bug Something isn't working

Comments

@Totktonada
Copy link
Member

proc = Popen(command, cwd=project_dir, stdout=PIPE, stderr=STDOUT)

Quote from a test output:

ok     10   integration.general.tls:false.test_constants
o2023-05-29 14:44:29.789 [2895436] main/103/luatest/etcd-client.client.pool V> etcd transport | req: /kv/put {"key":"a2V5XzAwMDAwMjk=","value":"dmFsdWVfMzA="}
<...>
2023-05-29 14:44:30.466 [2895436] main/103/luatest/etcd-client.client.pool V> etcd transport | req: /lease/grant {"ID":7587870927308614055,"TTL":60}
k     11    integration.general.tls:false.test_range_fetch_by_prefix
ok     12   integration.general.tls:false.test_range_fetch_range

Mixed in the middle of the 'ok' word.

test-run's diagnostics:

[092] etcd-client/etcd_client_general_integration_te>                 
[092] TAP13 parse failed (Descending test id on line: 'ok     12\tintegration.general.tls:false.test_range_fetch_range').
[092] 
[092] No result file (etcd-client/etcd_client_general_integration.result) found.
[092] Run the test with --update-result option to write the new result file.
[092] [ fail ]

test-run/lib/pytap13.py

Lines 148 to 150 in 344becd

if t_attrs['id'] < self.__tests_counter:
raise ValueError(
"Descending test id on line: %r" % line)

I already suggested to don't mix the streams in various discussions. Now I'm insisting on it.

We should find another way to report stderr output in case of a failure. The mixing into stdout usually works due to the skipping of unparseable lines in the TAP13 parser, but it is an unstable solution.

@Totktonada Totktonada added the bug Something isn't working label May 29, 2023
Totktonada added a commit that referenced this issue May 29, 2023
Parse stdout as TAP13. Write stderr to a log file to show on a test
failure.

Fixes #392
Totktonada added a commit that referenced this issue May 29, 2023
Parse stdout as TAP13. Write stderr to a log file to show on a test
failure.

Fixes #392
Totktonada added a commit that referenced this issue May 30, 2023
Parse stdout as TAP13. Write stderr to a log file to show on a test
failure.

Fixes #392
ylobankov pushed a commit that referenced this issue May 31, 2023
Parse stdout as TAP13. Write stderr to a log file to show on a test
failure.

Fixes #392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant