-
Notifications
You must be signed in to change notification settings - Fork 694
tests/library/harness: get rid of warnings on un-closed files #15274
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
tests/library/harness: get rid of warnings on un-closed files #15274
Conversation
🟢 |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
⚪
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
⚪
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
860160f
to
b5c94c5
Compare
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
ydb/tests/library/harness/daemon.py
Outdated
@@ -92,6 +94,12 @@ def stderr_file_name(self): | |||
else: | |||
return None | |||
|
|||
def __del__(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай лучше в stop засунем? Выглядит так, что вызов stop обязателен в любом случае, а вот del вызывается менее детерминированно
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я сначала и вставил это в stop(), но оказалось, что есть тесты (около 45, см. первую сборку), в сценариях которых нужно останавливать ноды и запускать снова, объект Daemon при этом не пересоздаётся, -- то есть вызывается stop(), потом start(), и Daemon должен запуститься на тех же файлах, что он открывал в конструкторе.
Тут либо отдельный явный метод подчистки делать (не деструктор, но и не stop или kill) и найти место, где его правильно вызвать. Либо закрывать и открывать файлы заново не в конструкторе, а в stop и start. И возможно получить разные файлы для разных вызовов start (может хорошо, а может быть и неудобно).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я бы файлы просто с append бы открывал, и пусть пишут свой вывод в конец -- может это решит проблему?
⚪ Test history | Ya make output | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
tests/library/harness: get rid of warnings on un-closed files. `KiKiMRNode`-`Daemon` manage process of ydb node (ydbd). `Daemon` opens stderr, stdout. `KiKiMRNode` opens log file. Change `Daemon` to open all those files on (every) `Daemon.start()` and close on (every) `Daemon.{stop,kill}()` instead of opening them once at `KiKiMRNode`-`Daemon` construction and never closing.
tests/library/harness: get rid of warnings on un-closed files.
KiKiMRNode
-Daemon
manage process of ydb node (ydbd).Daemon
opens stderr, stdout.KiKiMRNode
opens log file.Change
Daemon
to open all those files on (every)Daemon.start()
and close on (every)Daemon.{stop,kill}()
instead of opening them once atKiKiMRNode
-Daemon
construction and never closing.