about summary refs log tree commit homepage
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorbofh@yhbt.net <bofh@yhbt.net>2021-03-14 23:17:24 +0000
committerEW <bofh@yhbt.net>2021-03-15 06:02:52 +0000
commitea5295e8e4dcfaec24efb5030557594aabe645cb (patch)
tree520c0c0ef489ebeaa024bd20bff0c7594b849b79 /test/test_helper.rb
parent89b4ea15506ada542ab218c6819cf236e0afb2a2 (diff)
downloadunicorn-ea5295e8e4dcfaec24efb5030557594aabe645cb.tar.gz
Otherwise we get test failures since we use sysread
and syswrite in many places
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index ba5ef16..d86f83b 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -28,6 +28,7 @@ require 'tempfile'
 require 'fileutils'
 require 'logger'
 require 'unicorn'
+require 'io/nonblock'
 
 if ENV['DEBUG']
   require 'ruby-debug'
@@ -291,3 +292,15 @@ def reset_sig_handlers
     trap(sig, "DEFAULT")
   end
 end
+
+def tcp_socket(*args)
+  sock = TCPSocket.new(*args)
+  sock.nonblock = false
+  sock
+end
+
+def unix_socket(*args)
+  sock = UNIXSocket.new(*args)
+  sock.nonblock = false
+  sock
+end