* [PATCH 0/3] minor test golfing to make worktree smaller
@ 2020-01-26 5:33 6% Eric Wong
2020-01-26 5:33 7% ` [PATCH 2/3] test_helper: remove unused `chunked_spawn' Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-01-26 5:33 UTC (permalink / raw)
To: unicorn-public
must. kill. code.
Eric Wong (3):
test/exec/test_exec: bring worker_processes down to 2
test_helper: remove unused `chunked_spawn'
test_upload: use spawn to simplify redirects
test/exec/test_exec.rb | 16 +++++++++-------
test/test_helper.rb | 26 --------------------------
test/unit/test_upload.rb | 13 ++++---------
3 files changed, 13 insertions(+), 42 deletions(-)
^ permalink raw reply [relevance 6%]
* [PATCH 2/3] test_helper: remove unused `chunked_spawn'
2020-01-26 5:33 6% [PATCH 0/3] minor test golfing to make worktree smaller Eric Wong
@ 2020-01-26 5:33 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-01-26 5:33 UTC (permalink / raw)
To: unicorn-public
It was added nearly 11 years ago in commit 6945342a1f0a4caa
("Transfer-Encoding: chunked streaming input support") but
never used.
---
test/test_helper.rb | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/test/test_helper.rb b/test/test_helper.rb
index c21f75d..94a5b1b 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -265,32 +265,6 @@ def wait_for_death(pid)
raise "PID:#{pid} never died!"
end
-# executes +cmd+ and chunks its STDOUT
-def chunked_spawn(stdout, *cmd)
- fork {
- crd, cwr = IO.pipe
- crd.binmode
- cwr.binmode
- crd.sync = cwr.sync = true
-
- pid = fork {
- STDOUT.reopen(cwr)
- crd.close
- cwr.close
- exec(*cmd)
- }
- cwr.close
- begin
- buf = crd.readpartial(16384)
- stdout.write("#{'%x' % buf.size}\r\n#{buf}")
- rescue EOFError
- stdout.write("0\r\n")
- pid, status = Process.waitpid(pid)
- exit status.exitstatus
- end while true
- }
-end
-
def reset_sig_handlers
%w(WINCH QUIT INT TERM USR1 USR2 HUP TTIN TTOU CHLD).each do |sig|
trap(sig, "DEFAULT")
^ permalink raw reply related [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-01-26 5:33 6% [PATCH 0/3] minor test golfing to make worktree smaller Eric Wong
2020-01-26 5:33 7% ` [PATCH 2/3] test_helper: remove unused `chunked_spawn' Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.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).