* [PATCH 1/5] t/spawn.t: additional tests for popen_rd
2016-05-22 20:57 5% [PATCH 0/5] a few more HTTP-async-related simplifications Eric Wong
@ 2016-05-22 20:57 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-05-22 20:57 UTC (permalink / raw)
To: meta
We need to ensure $? is set properly for users.
---
t/spawn.t | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/t/spawn.t b/t/spawn.t
index d52b646..9e58f67 100644
--- a/t/spawn.t
+++ b/t/spawn.t
@@ -70,6 +70,15 @@ use PublicInbox::Spawn qw(which spawn popen_rd);
is(sysread($fh, $buf, 6), 6, 'sysread got 6 bytes');
is($buf, "hello\n", 'tied gets works');
is(sysread($fh, $buf, 6), 0, 'sysread got EOF');
+ $? = 1;
+ close $fh;
+ is($?, 0, '$? set properly');
+}
+
+{
+ my $fh = popen_rd([qw(false)]);
+ close $fh;
+ isnt($?, 0, '$? set properly: '.$?);
}
{
@@ -80,6 +89,7 @@ use PublicInbox::Spawn qw(which spawn popen_rd);
'sysread returned quickly with EAGAIN');
is(kill(15, $pid), 1, 'child process killed early');
is(waitpid($pid, 0), $pid, 'child process reapable');
+ isnt($?, 0, '$? set properly: '.$?);
}
done_testing();
^ permalink raw reply related [relevance 7%]
* [PATCH 0/5] a few more HTTP-async-related simplifications
@ 2016-05-22 20:57 5% Eric Wong
2016-05-22 20:57 7% ` [PATCH 1/5] t/spawn.t: additional tests for popen_rd Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-05-22 20:57 UTC (permalink / raw)
To: meta
Since we'll be doing more expensive processes in repobrowse,
it's prudent to refactor and commonalize some of this code.
Here's a start...
Eric Wong (5):
t/spawn.t: additional tests for popen_rd
git-http-backend: remove process limit
git-http-backend: simplify dumb serving
http: rework async_pass support
git-http-backend: switch to async_pass
lib/PublicInbox/GitHTTPBackend.pm | 251 ++++++++++++++++----------------------
lib/PublicInbox/HTTP.pm | 24 +---
lib/PublicInbox/HTTPD/Async.pm | 45 ++++---
t/spawn.t | 10 ++
4 files changed, 143 insertions(+), 187 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-05-22 20:57 5% [PATCH 0/5] a few more HTTP-async-related simplifications Eric Wong
2016-05-22 20:57 7% ` [PATCH 1/5] t/spawn.t: additional tests for popen_rd Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).