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

Test output is truncated #20171

Closed
lilatomic opened this issue Nov 13, 2023 · 10 comments · Fixed by #20269
Closed

Test output is truncated #20171

lilatomic opened this issue Nov 13, 2023 · 10 comments · Fixed by #20269
Assignees
Labels
bug logging Issues that related to logging
Milestone

Comments

@lilatomic
Copy link
Contributor

Describe the bug
Output of tests is truncated.
Good:

15:47:01.49 [INFO] Completed: Run Pytest - src/python/pants/backend/helm/goals/lint_test.py:tests - succeeded.
============================= test session starts ==============================
--------8<-----------
src/python/pants/backend/helm/goals/lint_test.py::test_skip_lint PASSED  [100%]

- generated xml file: src.python.pants.backend.helm.goals.lint_test.py.tests.xml -
============================== 7 passed in 3.61s ===============================



✓ src/python/pants/backend/helm/goals/lint_test.py:tests succeeded in 4.13s.

Bad:

16:31:15.42 [INFO] Completed: Run Pytest - src/python/pants/backend/helm/goals/lint_test.py:tests - succeeded.
============================= test session starts ==============================
--------8<-----------
src/python/pants/backend/helm/goals/lint_test.py::test_skip_lint PASSED  [100%]


✓ src/python/pants/backend/helm/goals/lint_test.py:tests succeeded in 3.95s.

All the test output is captured, and I'm pretty sure it's being sent to be presented. I think it also has to do with the "vertical size" of the text, in that if I remove all the newlines from the message the full text is printed. There doesn't appear to be a major difference in behaviour between a shorter output and a much longer output, in that both have some truncation.

Pants version
2.19.0a0

OS
Linux

@lilatomic lilatomic added the bug label Nov 13, 2023
@lilatomic lilatomic self-assigned this Nov 13, 2023
@lilatomic
Copy link
Contributor Author

lilatomic commented Nov 13, 2023

seems to have been something from 05e89ec
using --no-dynamic-ui, the output isn't truncated. I guess the output is being printed, but the dynamic UI covers it?
using --dynamic-ui-renderer=experimental-prodash also works fine.

@lilatomic lilatomic reopened this Nov 13, 2023
@lilatomic
Copy link
Contributor Author

lilatomic commented Nov 13, 2023

reverting the upgrade of indicatif is sufficient to resolve this
specifically 0.17.4 is the breaking version

@lilatomic lilatomic removed their assignment Nov 13, 2023
@tgolsson
Copy link
Contributor

Can you isolate a repro? I haven't observed anything like this and I did a bunch of testing.

@tgolsson
Copy link
Contributor

Also, can you see it happening with anything except test output?

@kaos
Copy link
Member

kaos commented Nov 13, 2023

this issue was also identified by @stuhood in #19842

@tgolsson
Copy link
Contributor

Yeah. I've looked a bit at the indicatif codebase and if we can find a repro I can probably fix it. But I've been running with that fix locally and in multiple projects without seeing any issues. It does seem like a race-like problem so maybe dependent on load etc.

@lilatomic
Copy link
Contributor Author

I tried with the other goals. I think it affects them too, but it's harder to tell (lint and check are missing a few blank lines at the bottom).
The repro steps are just "do anything", so I think it might be environment dependent. I was trying in a sideproject, in the pants repo I was trying ./pants test --force --output=all src/python/pants/backend/helm/goals/lint_test.py to generate the above. It's consistent across shells (bash, fish) and terminals (gnome terminal, intellij's builtin, vscode's builtin).
System info:

uname -a
Linux MS-7A34 6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct  9 15:34:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

@tgolsson
Copy link
Contributor

Do you have any other setting overrides apart from that command line?

My output is consistently the following (>10 tries):

./pants test --force --output=all src/python/pants/backend/helm/goals/lint_test.py
11:54:47.35 [INFO] Completed: Run Pytest - src/python/pants/backend/helm/goals/lint_test.py:tests - succeeded.
============================= test session starts ==============================
collecting ... collected 7 items

src/python/pants/backend/helm/goals/lint_test.py::test_lint_non_strict_chart_passing PASSED [ 14%]
src/python/pants/backend/helm/goals/lint_test.py::test_lint_non_strict_chart_failing PASSED [ 28%]
src/python/pants/backend/helm/goals/lint_test.py::test_lint_strict_chart_failing PASSED [ 42%]
src/python/pants/backend/helm/goals/lint_test.py::test_global_lint_strict_chart_failing PASSED [ 57%]
src/python/pants/backend/helm/goals/lint_test.py::test_lint_strict_chart_passing PASSED [ 71%]
src/python/pants/backend/helm/goals/lint_test.py::test_one_lint_result_per_chart PASSED [ 85%]
src/python/pants/backend/helm/goals/lint_test.py::test_skip_lint PASSED  [100%]


✓ src/python/pants/backend/helm/goals/lint_test.py:tests succeeded in 2.18s.

So that has multiple differences to yours, and seems (a) correct and (b) consistent.

@lilatomic
Copy link
Contributor Author

that output should have the lines

- generated xml file: src.python.pants.backend.helm.goals.lint_test.py.tests.xml -
============================== 7 passed in 3.61s ===============================

I don't have any other overrides in place.

@tgolsson
Copy link
Contributor

tgolsson commented Nov 22, 2023

Ack, thanks. Got confused specifically by this part in the original post: --------8<----------- and having fewer tests. Just wanted to be sure we're comparing apples-to-apples. So I'm reproducing the wrong output every time. That's a good start. I'll have a bit more of a dig tomorrow but if I can't find a solution I'll revert the upgrade.

It's interesting, the reason I upgraded was for some other multiline output to work correctly -- streaming workunit logs into each job. That is broken on 0.17.4... 😢

Edit: And I have a repro outside of Pants! The issue is \n\n! That trips up indicatif space counting somehow.
Edit: Ok, as expected that was fairly obvious once a repo was isolated, indicatif is a nice codebase. Will see if upstream responds, otherwise we'll have to do like with console and use a fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug logging Issues that related to logging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants