about summary refs log tree commit homepage
path: root/t
DateCommit message (Collapse)
2009-11-09tests: ensure we process "START" from FIFO when starting
Avoid the chances of misfiring when waiting on the master process to start in case something bad happens or we're sharing the FIFO for other purposes.
2009-11-09tests: heartbeat-timeout: simplify and avoid possible race
It seems possible to have a race condition here with the FIFO being overloaded for both start detection and blocking. Since SIGSTOP is unavoidable, just use that instead and sleep immediately afterwards in case SIGSTOP is not processed in time.
2009-11-09tests: ensure proper accounting of worker_connections
Counting worker connections is easy-to-forget when implementing new concurrency models and forgetting to do it means new clients cannot be accepted. Fortunately some concurrency models tend to do it for us.
2009-11-09rev_thread_spawn: 16K chunked reads work better
When reading 4K chunks, performance is dismal under 1.8
2009-11-09tests: extra check to avoid race in reopen logs test
In Unicorn, the master reopens logs before the workers do in case the workers die while reopening logs. But for our test cases (and real-world usage) we need to ensure the workers have reopened logs as well.
2009-11-09tests: add executable permissions to t0102
2009-11-08rev_thread_spawn/revactor: fix TeeInput for short reads
Explicitly requested short reads may cause too much data to be returned, which would be bad and potentially break the application. We need to ensure proper IO#readpartial-like semantics in both of these models.
2009-11-08initial cut of the RevThreadSpawn model
Seems to pass all tests, but that may only mean our test cases are lacking...
2009-11-07tests: sha1.ru now handles empty bodies
env['rack.input']read(length) may return nil zero-sized inputs
2009-11-07tests: allow use of alternative sha1 implementations
sha1sum(1) is only common GNU systems, and it may be installed as gsha1sum on *BSDs. We'll also try using the openssl sha1 implementation, too. And finally, we'll provide our own Ruby sha1sum.rb implementation as a last resort. We go to great lengths to avoid our own Ruby version because we want to avoid putting too much trust in ourselves, our Ruby skills, and even the Ruby implementations. This is especially with regard to our knowledge and correct usage of Ruby 1.9 encoding support. It would actually be *easier* to only use sha1sum.rb and call it a day. We just choose to support SHA1 implementations provided by third parties if possible. Performance is not a factor since sha1sum.rb performance is very close to the C implementations.
2009-11-06cleanup worker heartbeat and master deathwatch
It turns out neither the EventMachine and Rev classes checked for master death in its heartbeat mechanism. Since we managed to forget the same thing twice, we now have a test case for it and also centralized the code to remove duplication.
2009-11-05t0100: more precise `expr` usage
It's also more portable since "+" isn't portable on FreeBSD.
2009-11-05ensure RACK_ENV is inherited from the parent env
Add tests to ensure we set it correctly and it gets passed down to the app.
2009-11-05tests: staggered trailer upload test
This test lead to two separate bugfixes in Unicorn, one in the HttpParser and the other in TeeInput. Ironically, this test was spawned from what I initially thought was a bug in the EvCore module used by Rev and EventMachine, but there was no bug in EvCore...
2009-11-05cleanup: remove unused t????.ru test files
2009-11-04t0004: tighten up timeout test
We've worked around trigger happy timeouts in the master since we track the timeout at a lower resolution here.
2009-11-01tests: make timeout tests reliable under 1.9
We need to resort to SIGSTOP to block off processes entirely since 1.9 uses native threads.
2009-10-31tests: avoid single backquote in echo
It's not portable to FreeBSD 7.2 /bin/sh
2009-10-30rev: split out heartbeat class
This module will be reused in upcoming Rev-derived concurrency models.
2009-10-27revactor: require 0.1.5, remove 0.1.4 workarounds
Also new are added basic HTTP tests for UNIX domain socket handling (for all models, now, of course).
2009-10-27test-lib: DWIM handling of temp UNIX sockets
2009-10-26tests: generate all dependencies atomically
Using a "+" suffix alone was not enough protection since we use evil recursive makes and can't share dependency info with parent makes. While this could be done more efficiently (even with recursive make), but it'd be harder to maintain. So we generate the dependencies later to and sacrifice efficiency on the initial run (but rarely/never again).
2009-10-26tests: error out if socat + curl aren't reachable
This makes it easier to figure out why tests are failing for people that forget to read t/README
2009-10-26tests: gracefully exit if EventMachine is not available
2009-10-26tests: only load Revactor tests under 1.9.1
Even though our tests do an extra check, it's faster to not unnecessarily invoke the check in the first place.
2009-10-26eventmachine: add async_sinatra support
This is should be compatible with how the Thin webserver provides async callback support. See http://github.com/raggi/async_sinatra for the details
2009-10-26tests: make large file memory tests more reliable
Use a bigger random_blob and run GC before checking RSS
2009-10-26eventmachine 0.12.8 passes all tests
This means Rainbows::DevFdBody async responses and large file streaming without slurping. This is only with eventmachine 0.12.8, it looks like 0.12.10 changes the attach/watch API...
2009-10-26eventmachine: get basic tests working
log reopens, graceful shutdown, HTTP error responses should all be working now.
2009-10-24tests: allow "make $model" to run tests for that model
This makes it easier to filter functionality by model.
2009-10-24t9000: bail if run with an unsupported/pointless model
We'll probably make AppPool at least not break down and die in the future, but for now just disable it if run directly.
2009-10-24tests: remove symlinks and small files, use Make
This will make it easier to enable and manage tests for new concurrency models.
2009-10-24tests: port all existing tests to TAP library
Everything passes, and "set -e" prevents us from making any stupid mistakes...
2009-10-24tests: add a TAP producer shell library
This will eventually allow our test output to be consumed by any TAP[1]-compatible consumers. Like the rest of our shell scripts, this only relies on POSIX behavior and has no bashisms. mktemp(1) is a requirement only if using the verbose output in this library. This library aims to be useful outside of Rainbows! [1]: Test Anything Protocol: http://testanything.org/
2009-10-24tests: common setup and wait_start functions
Instead of sleeping and waiting for a PID file to appear, just use a named-pipe and block on it in the test scripts since we know Unicorn won't attempt to fork until sockets are already bound.
2009-10-24tests: prefer "RUBY" to lowercased "ruby"
It's more common form for externally-visible/modifiable variables in Makefiles and shell scripts.
2009-10-24tests: avoid race condition in reopen logs test
Ensure our workers are capable of processing requests before we can continue to setup signal handlers. The later "kill -USR1" signal may fire in our test script before the workers have a chance to setup the handlers. So by the time we receive a positive response, we _know_ signal handlers are ready.
2009-10-22tests: hopefully fix stalls in input trailer tests
utee is line-oriented on _read_, so avoid messing with that for this. Additionally, spawn our FIFO cats before we start writing gobs of data out since it could cause the writers to block otherwise.
2009-10-20tests: avoid needlessly remaking "rainbows"
The cmp test was completely unnecessary and pointless.
2009-10-19rev: fix static file responses under HTTP/0.9
Since HTTP/0.9 responses have no headers to write, the on_write_complete handler we rely on never got triggered, leading to additional reads to never get queued up. Additionally, we need to explicitly detect and close client sockets if we've written the last response body since HTTP/0.9 clients never know when it's time to close a connection.
2009-10-19test-lib: avoid stalling due to bad FIFO handling
Don't try to clobber FIFOs at startup since sometimes traps may not fire. And while we're at it, avoid trying to unlink them twice.
2009-10-19tests: more correct HTTP/0.9 test
The extra CRLF is not needed for HTTP/0.9
2009-10-18tests: predictable and simpler tempfile management
Instead of using completely random names, we'll use predictable ones since we already depend on them for exit codes and such. This drops our ability to run the same test for the same version of Ruby in the same working tree, but that's an unlikely scenario. While we're at it, avoid remove tempfiles if a test failed. This should make debugging easier.
2009-10-18tests: DWIM FIFO creation
If we're going to name a variable "fifo", it'll be for descriptive reasons...
2009-10-18tests: more reliable error checking
We now check for SIGKILL, too
2009-10-18rev: async response bodies with DevFdResponse middleware
This new middleware should be a no-op for non-Rev concurrency models (or by explicitly setting env['rainbows.autochunk'] to false). Setting env['rainbows.autochunk'] to true (the default when Rev is used) allows (e)poll-able IO objects (sockets, pipes) to be sent asynchronously after app.call(env) returns. This also has a fortunate side effect of introducing a code path which allows large, static files to be sent without slurping them into a Rev IO::Buffer, too. This new change works even without the DevFdResponse middleware, so you won't have to reconfigure your app. This lets us epoll on response bodies that come in from a pipe or even a socket and send them either straight through or with chunked encoding.
2009-10-17tests: for log reopening for all concurrency models
2009-10-17tests: rack.input hammer concurrency testing
2009-10-17tests: common basic HTTP tests for all models
We support pipelining, keepalive, and even HTTP/0.9!
2009-10-17tests: DRY require tests for Rev/Revactor