unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Jeremy Evans <jeremyevans0@gmail.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Fix hang when running tests on OpenBSD by skipping two tests
Date: Tue, 15 Nov 2011 22:19:34 +0100	[thread overview]
Message-ID: <CADGZSScfcrfN1UkmYeqkVS-P4SdObhvauqmYc2JiBabbK_cpUQ@mail.gmail.com> (raw)
In-Reply-To: <CADGZSSe0CUn2nW5zzSh=Da4HO7F7OX7zu+CWEhE7v=cU2J1Gng@mail.gmail.com>

On Tue, Nov 15, 2011 at 9:03 PM, Jeremy Evans <jeremyevans0@gmail.com> wrote:
> openssl sha1 on OpenBSD doesn't just spit out the hash:
>
> $ openssl sha1 mocha.diff
> SHA1(mocha.diff)= 4ea47d3cf9e4f1858a298a8a9f5a5671422971d5
> $ sha1 -q mocha.diff
> 4ea47d3cf9e4f1858a298a8a9f5a5671422971d5

Here's a fix for t/test-lib.sh that handles unix socket paths where
you are running the regression tests for a long directory name.  I
didn't catch this earlier because the unix socket test only fails on
ruby 1.9 port on my system, since the path name is a little longer for
the ruby19 flavor than the unflavored ruby 1.8 port.

You probably want to use more robust name mangling if you choose to
fix this, my fix is simple but has corner cases where it breaks that
could be problematic.

Jeremy

--- t/test-lib.sh.orig  Thu Jan  1 01:00:00 1970
+++ t/test-lib.sh       Tue Nov 15 22:02:59 2011
@@ -38,20 +38,24 @@ rtmpfiles () {
        for id in "$@"
        do
                name=$id
-               _tmp=$t_pfx.$id
-               eval "$id=$_tmp"

                case $name in
                *fifo)
+                       _tmp=$t_pfx.$id
+                       eval "$id=$_tmp"
                        rm -f $_tmp
                        mkfifo $_tmp
                        T_RM_LIST="$T_RM_LIST $_tmp"
                        ;;
                *socket)
+                       _tmp=$(echo "$t_pfx.$id" | $RUBY -e 'print
$stdin.read(103)')
+                       eval "$id=$_tmp"
                        rm -f $_tmp
                        T_RM_LIST="$T_RM_LIST $_tmp"
                        ;;
                *)
+                       _tmp=$t_pfx.$id
+                       eval "$id=$_tmp"
                        > $_tmp
                        T_OK_RM_LIST="$T_OK_RM_LIST $_tmp"
                        ;;
@@ -101,6 +105,7 @@ unicorn_wait_start () {

 rsha1 () {
        _cmd="$(which sha1sum 2>/dev/null || :)"
+       test -n "$_cmd" || _cmd="$(which sha1 2>/dev/null || :) -q"
        test -n "$_cmd" || _cmd="$(which openssl 2>/dev/null || :) sha1"
        test "$_cmd" != " sha1" || _cmd="$(which gsha1sum 2>/dev/null || :)"
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

  reply	other threads:[~2011-11-15 21:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 19:33 Fix hang when running tests on OpenBSD by skipping two tests Jeremy Evans
2011-11-14 20:54 ` Eric Wong
2011-11-14 23:46   ` Jeremy Evans
2011-11-15  3:17     ` Eric Wong
2011-11-15 20:03       ` Jeremy Evans
2011-11-15 21:19         ` Jeremy Evans [this message]
2011-11-15 22:36         ` Eric Wong
2011-11-16  1:18         ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADGZSScfcrfN1UkmYeqkVS-P4SdObhvauqmYc2JiBabbK_cpUQ@mail.gmail.com \
    --to=jeremyevans0@gmail.com \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).