* [PATCH 3/3] test_upload: use spawn to simplify redirects
2020-01-26 5:33 4% [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
We can start using Ruby 1.9 APIs, nowadays (right?)
---
test/unit/test_upload.rb | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/test/unit/test_upload.rb b/test/unit/test_upload.rb
index 5de02e4..8d90e50 100644
--- a/test/unit/test_upload.rb
+++ b/test/unit/test_upload.rb
@@ -236,15 +236,10 @@ def test_chunked_upload_via_curl
resp = Tempfile.new('resp')
resp.sync = true
- rd, wr = IO.pipe
- wr.sync = rd.sync = true
- pid = fork {
- STDIN.reopen(rd)
- rd.close
- wr.close
- STDOUT.reopen(resp)
- exec cmd
- }
+ rd, wr = IO.pipe.each do |io|
+ io.sync = io.close_on_exec = true
+ end
+ pid = spawn(*cmd, { 0 => rd, 1 => resp })
rd.close
tmp.rewind
^ permalink raw reply related [relevance 7%]
* [PATCH 0/3] minor test golfing to make worktree smaller
@ 2020-01-26 5:33 4% Eric Wong
2020-01-26 5:33 7% ` [PATCH 3/3] test_upload: use spawn to simplify redirects 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 4%]
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 4% [PATCH 0/3] minor test golfing to make worktree smaller Eric Wong
2020-01-26 5:33 7% ` [PATCH 3/3] test_upload: use spawn to simplify redirects 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).