close stdout/stderr handles in run_shell_cmd and test teardown + remove duplication in toy_build tests - #5050
Conversation
8a97235 to
328593a
Compare
328593a to
cd41ff6
Compare
cd41ff6 to
41d31e4
Compare
|
Rebased |
|
@Flamefire Needs conflict fixing |
41d31e4 to
df96819
Compare
|
Rebased to fix |
4d5fbd6 to
6045c01
Compare
Avoid the repaeted reads in almost every test.
The stdin/stdout/stderr handles need be closed by calling `communicate`. Otherwise the handles will be leaked and e.g. `test_run_shell_cmd_qa_trace` fails because it may capture a related warning.
run_shell_cmd and test teardown + remove duplication in toy_build tests
|
I noticed there are > 200 similar cases in other test files. |
@Flamefire Sure, sounds like a nice cleanup in the tests. (sorry for the late reply, I often overlook comments in merged PRs) |
|
Followup done: #5203
|
Almost every test case starts by getting the path to the test-folder, then to
toy-0.0.eband then reading this file.Not only makes this harder to read the (relevant part of) the test it also slows it down to read the same file in every test.
Hence I factored those out to file-level constants.
While testing I noticed we don't close the mocked stdout/stderr buffers and added that too