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

Python SDK test TestOperationCommands::test_operation_stderr_output fails #577

Open
dmi-feo opened this issue May 10, 2024 · 1 comment
Open
Assignees
Labels
SDK SDK related

Comments

@dmi-feo
Copy link
Contributor

dmi-feo commented May 10, 2024

tests/test_operations.py::TestOperationCommands::test_operation_stderr_output

        op = yt.run_map("echo -e -n 'someerrout' >&2; cat", input_table, output_table, sync=False, job_count=1)
        with set_config_option("operation_tracker/always_show_job_stderr", True):
            caplog.clear()                                                                                                                                                                                                                                op.wait()
        assert op.get_state() == "completed"
>       assert any("someerrout" in rec.message for rec in caplog.records)                                                                                                                                                                     E       assert False
E        +  where False = any(<generator object TestOperationCommands.test_operation_stderr_output.<locals>.<genexpr> at 0x7fbfd88c7d60>)
tests/test_operations.py:1033: AssertionError

It fails because caplog captures no records at all.

I've found two ways to make the test pass:

  1. Enable propagate for Yt logger here. Having propagation enabled the root logger must start handling records as well as Yt logger. However, logging directly to the root logger here without propagation doesn't help, which is weird since the only logger records will be propagated to is the root one.
  2. Configure logger the same way it is done for arcadia environment. It replaces Yt logger with the root one, but still it is unclear why the test fails when the root logger is used explicitly.
@dmi-feo
Copy link
Contributor Author

dmi-feo commented May 10, 2024

By the way, is it okay that caplog.clear() is called after run_map? It seems it can wipe the information we wait for in case of too fast map operation.

@Kontakter Kontakter self-assigned this May 13, 2024
@Kontakter Kontakter added the SDK SDK related label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK SDK related
Projects
None yet
Development

No branches or pull requests

2 participants