Skip to content

Commit

Permalink
testsuite: remove check for short write in rexec tests
Browse files Browse the repository at this point in the history
Problem: The rexec and rexec_getline tests in the testsuite check
for a short write from flux_subprocess_write(), but this is no longer
possible.

Remove the special case for a short write return code from
flux_subprocess_write() in these test programs.
  • Loading branch information
grondo committed Nov 9, 2023
1 parent d490978 commit 2e8a643
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions t/rexec/rexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,14 @@ void state_cb (flux_subprocess_t *p, flux_subprocess_state_t state)
void stdin2stream (flux_subprocess_t *p, const char *stream)
{
char *buf = NULL;
int tmp, len;
int len;

if ((len = read_all (STDIN_FILENO, (void **)&buf)) < 0)
log_err_exit ("read_all");

if (len) {
if ((tmp = flux_subprocess_write (p, stream, buf, len)) < 0)
if (flux_subprocess_write (p, stream, buf, len) < 0)
log_err_exit ("flux_subprocess_write");

if (tmp != len)
log_err_exit ("overflow in write");
}

/* do not close for channel, b/c can race w/ data coming back */
Expand Down
7 changes: 2 additions & 5 deletions t/rexec/rexec_getline.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,14 @@ void completion_cb (flux_subprocess_t *p)
void stdin2stream (flux_subprocess_t *p, const char *stream)
{
char *buf = NULL;
int tmp, len;
int len;

if ((len = read_all (STDIN_FILENO, (void **)&buf)) < 0)
log_err_exit ("read_all");

if (len) {
if ((tmp = flux_subprocess_write (p, stream, buf, len)) < 0)
if (flux_subprocess_write (p, stream, buf, len) < 0)
log_err_exit ("flux_subprocess_write");

if (tmp != len)
log_err_exit ("overflow in write");
}

/* do not close for channel, b/c can race w/ data coming back */
Expand Down

0 comments on commit 2e8a643

Please sign in to comment.