saleyn / erlexec

Execute and control OS processes from Erlang/OTP
https://hexdocs.pm/erlexec/readme.html
Other
525 stars 139 forks source link

Allow to set winsz on run #164

Closed SteffenDE closed 2 years ago

SteffenDE commented 2 years ago

This PR allows to set the pty window size on exec:run.

SteffenDE commented 2 years ago

One question: https://github.com/saleyn/erlexec/blob/e6ed55277e97e54f60fdf8053a00a7918fc22ae5/c_src/exec_impl.cpp#L190 Should this line use TIOCSWINSZ instead of TIOCGWINSZ?

SteffenDE commented 2 years ago

Second question: https://github.com/saleyn/erlexec/commit/e6ed55277e97e54f60fdf8053a00a7918fc22ae5 removed the make test call from GitHub Actions again, is this intended?

saleyn commented 2 years ago

Should this line use TIOCSWINSZ instead of TIOCGWINSZ?

Thank you. This was a typo. Fixing.

Second question: https://github.com/saleyn/erlexec/commit/e6ed55277e97e54f60fdf8053a00a7918fc22ae5 removed the make test call from GitHub Actions again, is this intended?

I am trying to get the CI working with all the tests, but though they run locally successfully, some of them fail in the CI-CD environment for unclear reason. So I temporarily commented that out while trying to figure out the cause.

saleyn commented 2 years ago

@SteffenDE, after applying the patch two test cases fail:

.................
erlexec/src/exec.erl:1780:<0.247.0>: ==> TEST test_pty_opts FAILED!!!
erlexec/src/exec.erl:1856:<0.247.0>: ==> TEST test_dynamic_pty_opts FAILED!!!
F
F
==> Test Concurrency: 900
.
Failures:

  1) exec:exec_test_/0:1494
     Failure/Error: ?assertMatch({ stdout , I , << "started\r\n" >> }, timeout)
       expected: = { stdout , I , << "started\r\n" >> }
            got: timeout
     %% eunit_proc.erl:570:in `eunit_proc:run_group/2`
     Output: 
     Output: 
  2) exec:exec_test_/0:1495
     Failure/Error: ?assertMatch({ stdout , I , << "test\r\n" >> }, timeout)
       expected: = { stdout , I , << "test\r\n" >> }
            got: timeout
     %% eunit_proc.erl:570:in `eunit_proc:run_group/2`
     Output: 
     Output: 

Finished in 23.865 seconds
20 tests, 2 failures
===> Error running tests
SteffenDE commented 2 years ago

I'm having a look 👍🏻 I'll post a PR for test_pty_echo soon as it also suffers from the "data may arrive in one or two messages"; will try to find out why the others fail too.