Fix hang when running tests on OpenBSD by skipping two tests

Jeremy Evans jeremyevans0 at
Mon Nov 14 18:46:31 EST 2011

On Mon, Nov 14, 2011 at 9:54 PM, Eric Wong <normalperson at> wrote:
> Jeremy Evans <jeremyevans0 at> wrote:
>> This is obviously not a permanent fix, but I'm not sure why the tests
>> are hanging, and hanging during a test is bad.  I suppose you could
>> also use a timeout, so the test fails instead of hangs.  I'll be happy
>> to test other patches to either the test suite or the library code
>> (assuming the hang is fixable on OpenBSD).
> I'd like to investigate why this fails.

Makes sense.  Is there something I can do to help debug?

> So everything under t/ (gmake test-integration) works, too?
> I much prefer shell-based the test suite myself

I didn't even know about that test suite till now. :)

I started running those tests on OpenBSD.  With the way the test suite
is currently setup, it's a bit of a pain to debug, as it stops at the
first error.  So I have to:

1) run the entire test suite
2) wait for it to halt/fail
3) skip the test that halts/fails
4) go to step 1

With some small changes, you can make it through the entire test suite
even if there are errors.  It would greatly speed up the debugging
process, but it does require you read the logged output.  See the
patch below.  With it, I determined the following integration tests

ruby 1.8.7 and ruby 1.9.3 integration test failures:
# fails: not ok 11 - no errors
# hangs: requires kill to unicorn and kill -9 to sh in the 2nd test

ruby 1.9.3 has a couple regular test failures (skipping the two hangs
with the earlier patch):

:   1) Error:
: test_parse_error(HttpParserTest):
: RuntimeError: can't set length of shared string
:     test/unit/test_http_parser.rb:350:in `headers'
:     test/unit/test_http_parser.rb:350:in `test_parse_error'

:   1) Failure:
: test_help(ExecTest) [test/exec/test_exec.rb:319]:
: <0> expected but was
: <158>.


--- GNUmakefile.orig    Tue Nov 15 00:12:58 2011
+++ GNUmakefile Tue Nov 15 00:13:32 2011
@@ -124,14 +124,14 @@ run_test = $(quiet_pre) \
 %.n: export PATH := $(test_prefix)/bin:$(PATH)
 %.n: export RUBYLIB := $(test_prefix):$(test_prefix)/lib:$(MYLIBS)
 %.n: $(test_prefix)/.stamp
-       $(run_test)
+       -$(run_test)

 $(T): arg = $@
 $(T): t = $(subst .rb,$(log_suffix),$@)
 $(T): export PATH := $(test_prefix)/bin:$(PATH)
 $(T): export RUBYLIB := $(test_prefix):$(test_prefix)/lib:$(MYLIBS)
 $(T): $(test_prefix)/.stamp
-       $(run_test)
+       -$(run_test)

 install: $(bins) $(ext)/unicorn_http.c
@@ -221,7 +221,7 @@ $(T_r).%.r: export RUBYLIB := $(test_prefix):$(test_pr
 $(T_r).%.r: export UNICORN_RAILS_TEST_VERSION = $(rv)
 $(T_r).%.r: export RAILS_GIT_REPO = $(CURDIR)/$(rails_git)
 $(T_r).%.r: $(test_prefix)/.stamp $(rails_git)/info/v2.2.3-stamp
-       $(run_test)
+       -$(run_test)

 ifneq ($(VERSION),)
 rfproject := mongrel

--- t/GNUmakefile.orig  Tue Nov 15 00:12:39 2011
+++ t/GNUmakefile       Tue Nov 15 00:12:50 2011
@@ -66,7 +66,7 @@ $(T): export RAKE := $(RAKE)
 $(T): export PATH := $(test_prefix)/bin:$(PATH)
 $(T): export RUBYLIB := $(test_prefix)/lib:$(MYLIBS)
 $(T): dep $(test_prefix)/.stamp trash/.gitignore
-       $(TRACER) $(SHELL) $(SH_TEST_OPTS) $@ $(TEST_OPTS)
+       -$(TRACER) $(SHELL) $(SH_TEST_OPTS) $@ $(TEST_OPTS)

        mkdir -p $(@D)

More information about the mongrel-unicorn mailing list