about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-01 21:46:05 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-01 21:46:05 -0700
commiteb34caa3f4b8cedddb14b9e4e0415e2258802134 (patch)
tree9f1864315ca9fee54549a50ce88e528ced43b367 /test
parenta139c4c8e3555bc30b72fe05e6009da5cc37c280 (diff)
downloadunicorn-eb34caa3f4b8cedddb14b9e4e0415e2258802134.tar.gz
We need to ensure the next request has started
processing before we can guarantee a temp file
has been unlinked.
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_upload.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/test_upload.rb b/test/unit/test_upload.rb
index 8246f65..58058f1 100644
--- a/test/unit/test_upload.rb
+++ b/test/unit/test_upload.rb
@@ -74,6 +74,12 @@ class UploadTest < Test::Unit::TestCase
     sock.close
     assert path != path2
 
+    # make sure the next request comes in so the unlink got processed
+    sock = TCPSocket.new(@addr, @port)
+    sock.syswrite("GET ?lasdf\r\n\r\n\r\n\r\n")
+    sock.sysread(4096) rescue nil
+    sock.close
+
     assert ! File.exist?(path)
   end