about summary refs log tree commit homepage
path: root/test
DateCommit message (Collapse)
2012-08-06avoid assert_nothing_raised in unit tests
It's better to show errors and backtraces when stuff breaks
2012-07-28remove Rails-oriented integration tests
It's too much overhead to keep Rails-specific tests working, especially when it's hauling in an ancient version of SQLite3. Since Rails 3 has settled down with Rack and unicorn_rails is unlikely to need changing in the future, we can drop these tests.
2012-01-27disable old Rails tests for Ruby 2.0.0
I doubt anybody would attempt to run ancient, unsupported versions of Rails on the latest (unreleased, even) versions of Ruby...
2011-12-17http: test case for "Connection: TE"
We need to be sure we don't barf on this header.
2011-11-15test_helper: ensure test client connects to valid address
You can listen on 0.0.0.0, but trying to connect to it doesn't work well on OpenBSD. Acked-by: Eric Wong <normalperson@yhbt.net>
2011-09-15add preliminary SSL support
This will also be the foundation of SSL support in Rainbows! and Zbatery. Some users may also want to use this in Unicorn on LANs to meet certain security/auditing requirements. Of course, Nightmare! (in whatever form) should also be able to use it.
2011-08-29add GPLv3 option to the license
Existing license terms (Ruby-specific) and GPLv2 remain in place, but GPLv3 is preferred as it helps with distribution of AGPLv3 code and is explicitly compatible with Apache License (v2.0). Many more reasons are documented by the FSF: https://www.gnu.org/licenses/quick-guide-gplv3.html http://gplv3.fsf.org/rms-why.html ref: http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/933
2011-08-23test_helper: remove needless LOAD_PATH mangling
We do it in the Ruby invocation or RUBYLIB.
2011-08-11test_socket_helper: Socket#bind may fail with EINVAL if IPv6 is missing
I don't build IPv6 into all my kernels; maybe other testers do not, either.
2011-07-13http: reject non-LWS CTL chars (0..31 + 127) in field values
RFC 2616 doesn't appear to allow most CTL bytes even though Mongrel always did. Rack::Lint disallows 0..31, too, though we allow "\t" (HT, 09) since it's LWS and allowed by RFC 2616.
2011-06-29fix per-worker listen directive in after_fork hook
The testcase for this was broken, too, so we didn't notice this :< Reported-by: ghazel@gmail.com on the Rainbows! mailing list, http://mid.gmane.org/BANLkTi=oQXK5Casq9SuGD3edeUrDPvRm3A@mail.gmail.com
2011-06-17test_http_parser: fix for URI too long errors (#3)
The random garbage generator may occasionally generate URIs that are too long and cause the URI-specific error to be raised instead of the generic parser error we recently introduced. Follow-up-to: commit 742c4d77f179a757dbcb1fa350f9d75b757acfc7
2011-06-17ensure at_exit handlers run on graceful shutdown
rescuing from SystemExit and exit()-ing again is ugly, but changes made to lower stack depth positively affect _everyone_ so we'll tolerate some ugliness here. We'll need to disable graceful exit for some tests, too...
2011-06-16replace fchmod()-based heartbeat with raindrops
This means we no longer waste an extra file descriptor per worker process in the master. Now there's no need to set a higher file descriptor limit for systems running >= 1024 workers.
2011-06-15test_http_parser: fix for URI too long errors (again)
The random garbage generator may occasionally generate URIs that are too long and cause the URI-specific error to be raised instead of the generic parser error we recently introduced. Follow-up-to: commit 742c4d77f179a757dbcb1fa350f9d75b757acfc7
2011-06-15test_response: httpdate is low resolution
It may return the previous second
2011-06-15test_http_parser: fix for URI too long errors
The random garbage generator may occasionally generate URIs that are too long and cause the URI-specific error to be raised instead of the generic parser error we recently introduced.
2011-06-13http: dechunk! method to enter dechunk mode
This allows one to enter the dechunker without parsing HTTP headers beforehand. Since we skipped header parsing, trailer parsing is not supported since we don't know what trailers might be (to our knowledge, nobody uses trailers anyways)
2011-06-10test/benchmark/stack.ru: app for measuring stack depth
Stack depth affects Ruby GC performance, so lowering it makes sense
2011-06-07configurator: add :ipv6only directive
Enabling this flag for an IPv6 TCP listener allows users to specify IPv6-only listeners regardless of the OS default. This should be interest to Rainbows! users.
2011-05-23strip trailing and leading linear whitespace in headers
RFC 2616, section 4.2: > The field-content does not include any leading or trailing LWS: > linear white space occurring before the first non-whitespace > character of the field-value or after the last non-whitespace > character of the field-value. Such leading or trailing LWS MAY be > removed without changing the semantics of the field value. Any LWS > that occurs between field-content MAY be replaced with a single SP > before interpreting the field value or forwarding the message > downstream.
2011-04-13fix some 1.9.3dev warnings
2011-04-01drop Rails 2.3.x tests
They were transitionary releases and the logic to deal with them and Rack versioning was too much overhead.
2011-02-10Revert "test_helper: simplify random port binding"
This causes conflicts with ports clients may use in the ephemeral range since those do not hold FS locks. This reverts commit e597e594ad88dc02d70f7d3521d0d3bdc23739bb. Conflicts: test/test_helper.rb
2011-02-07test_helper: avoid FD leakage/waste
No need to unnecessarily leave file descriptor open.
2011-02-03test/unit: fix tests under Ruby 1.9.3dev
Ugh, one day I'll clean them up, one day...
2011-02-02Fix Ruby 1.9.3dev warnings
for i in `git ls-files '*.rb'`; do ruby -w -c $i; done
2011-02-02test_helper: simplify random port binding
Duh...
2011-02-02allow binding on IPv6 sockets with listen "[#{addr}]:#{port}"
This is much like how nginx does it, except we always require a port when explicitly binding to IPv6 using the "listen" directive. This also adds support to listen with an address-only, which can be useful to Rainbows! users.
2011-02-02http: parser handles IPv6 bracketed IP hostnames
Just in case we have people that don't use DNS, we can support folks who enter ugly IPv6 addresses... IPv6 uses brackets around the address to avoid confusing the colons used in the address with the colon used to denote the TCP port number in URIs.
2011-01-31test_upload: check size in server
The client may not get a proper response with TCP_CORK enabled
2011-01-07http_response: do not skip Status header set by app
Rack::Lint already stops apps from using it. If a developer insists on it, then users who inspect their HTTP headers can point and laugh at them for not using Rack::Lint!
2011-01-05close client socket after closing response body
Response bodies may capture the block passed to each and save it for body.close, so don't close the socket before we have a chance to call body.close
2011-01-05http_parser: add clear method, deprecate reset
But allows small optimizations to be made to avoid constant/instance variable lookups later :)
2011-01-05http_response: simplify the status == 100 comparison
No need to preserve the response tuplet if we're just going to unpack it eventually.
2011-01-04http_response: implement httpdate in C
This can return a static string and be significantly faster as it reduces object allocations and Ruby method calls for the fastest websites that serve thousands of requests a second. It assumes the Ruby runtime is single-threaded, but that is the case of Ruby 1.8 and 1.9 and also what Unicorn is all about. This change is safe for Rainbows! under 1.8 and 1.9.
2010-12-30http_response: do not account for $, being set
It's a minor garbage reduction, but nobody uses "$,", and if they did, they'd break things in the Ruby standard library as well as Rack, so let anybody who uses "$," shoot themselves in the foot.
2010-12-30tests: test parser works with keepalive_requests=0
We use this in Rainbows! to disable keepalive in certain configurations.
2010-12-26http: #keepalive? and #headers? work after #next?
We need to preserve our internal flags and only clear them on HttpParser#parse. This allows the async concurrency models in Rainbows! to work properly.
2010-12-25http: fix typo in xftrust unit test
Oops
2010-12-21http: hook up "trust_x_forwarded" to configurator
More config bloat, sadly this is necessary for Rainbows! :<
2010-12-20http: allow ignoring X-Forwarded-* for url_scheme
Evil clients may be exposed to the Unicorn parser via Rainbows!, so we'll allow people to turn off blindly trusting certain X-Forwarded* headers for "rack.url_scheme" and rely on middleware to handle it.
2010-12-20http: update setting of "https" for rack.url_scheme
The first value of X-Forwarded-Proto in rack.url_scheme should be used as it can be chained. This header can be set multiple times via different proxies in the chain, but consider the first one to be valid. Additionally, respect X-Forwarded-SSL as it may be passed with the "on" flag instead of X-Forwarded-Proto. ref: rack commit 85ca454e6143a3081d90e4546ccad602a4c3ad2e and 35bb5ba6746b5d346de9202c004cc926039650c7
2010-12-20http: support keepalive_requests directive
This limits the number of keepalive requests of a single connection to prevent a single client from monopolizing server resources. On multi-process servers (e.g. Rainbows!) with many keepalive clients per worker process, this can force a client to reconnect and increase its chances of being accepted on a less-busy worker process. This directive is named after the nginx directive which is identical in function.
2010-12-19http: delay clearing env on HttpParser#next?
This allows apps/middlewares on Rainbows! that rely on env in the response_body#close to hold onto the env.
2010-11-20tests: stream_input tests for mixed gets/read calls
Some apps may do them, so make sure we do them correctly.
2010-11-20stream_input: small cleanups and fixes
No need to accept any number of args, that could hide bugs in applications that could give three or more arguments. We also raise ArgumentError when given a negative length argument to read.
2010-11-18stream_input: read with zero length returns ''
Any calls to read with an explicit zero length now returns an empty string. While not explicitly specified by Rack::Lint, this is for compatibility with StringIO and IO methods which are common in other web servers.
2010-11-13tee_input: restore read position after #size
It's possible for an application to call size after it has read a few bytes/lines, so do not screw up a user's read offset when consuming input.
2010-11-11http_parser: ensure keepalive is disabled when reset
We'll need this in Rainbows!