From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.6 required=5.0 tests=FREEMAIL_FROM, MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Andrew Milkowski Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: test failure on Mac OSX Date: Fri, 25 Jun 2010 19:51:01 -0400 Message-ID: References: <20100625183518.GA32646@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1277509969 16424 80.91.229.12 (25 Jun 2010 23:52:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 Jun 2010 23:52:49 +0000 (UTC) To: unicorn list Original-X-From: mongrel-unicorn-bounces@rubyforge.org Sat Jun 26 01:52:45 2010 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=TXuhAL46TZHZvkX5vFrDmRZ+154mnzTFBIdUrd8g78g=; b=f7Iyj1iOEaK2ajLavWlmoFNnDnrDHXwj4CfGNd3giSgH8lvoNc4YjezTIo7xEVBnub PgDWpQwtI7Dl1ulQR7ABh4nA2js5eiAjp0Z9gJG7K7f47fve5AXEhIPcby5OO5ZVFgYw /eefaY/BlKcfPKd0C1GESUXz2/0+hQvrdgVhg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=iXdcTC+cWWWnXgOxGmoICx3ega37nX3zUjkbMYJfzHq0QlZELJbz38MYsBnvPxcQkL Dve0n5zQfcGBUouIDauM5KOmwgYrvNSFM0sjVUN3FKL0ohQWZbAk3ON4Ani8Jen3RM1S i4m99pfduffzM/KmoPpUtUp/U+O5lOwZMZbZE= In-Reply-To: <20100625183518.GA32646@dcvr.yhbt.net> X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:612 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OSIhQ-0003xr-Ix for gclrug-mongrel-unicorn@m.gmane.org; Sat, 26 Jun 2010 01:52:44 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id F10FF185835A; Fri, 25 Jun 2010 19:52:43 -0400 (EDT) Received: from mail-vw0-f50.google.com (mail-vw0-f50.google.com [209.85.212.50]) by rubyforge.org (Postfix) with ESMTP id 01F9B1858348 for ; Fri, 25 Jun 2010 19:51:01 -0400 (EDT) Received: by vws14 with SMTP id 14so1040195vws.23 for ; Fri, 25 Jun 2010 16:51:01 -0700 (PDT) Received: by 10.220.47.89 with SMTP id m25mr783852vcf.217.1277509861435; Fri, 25 Jun 2010 16:51:01 -0700 (PDT) Received: by 10.220.194.135 with HTTP; Fri, 25 Jun 2010 16:51:01 -0700 (PDT) Thanks Eric! wonderful, all test passed (with very minimal CPU strain) I also enabled full 64 bit kernel so that helps I am sure. and yes, very true var is symlinked under 10.6 (not sure if this was the case <) thanks that was wonderful weekend gift (I am now unblocked) and try other things with this container have a wonderful weekend! bash-3.2$ ls -l var lrwxr-xr-x@ 1 root wheel 11 Feb 1 18:44 var -> private/var bash-3.2$ bash-3.2$ make * test/unit/test_configurator.rb * test/unit/test_http_parser.rb * test/unit/test_http_parser_ng.rb * test/unit/test_request.rb * test/unit/test_response.rb * test/unit/test_socket_helper.rb * test/unit/test_tee_input.rb * test/unit/test_util.rb * test/unit/test_server.rb -n test_preload_app_config * test/unit/test_server.rb -n test_broken_app * test/unit/test_server.rb -n test_simple_server * test/unit/test_server.rb -n test_client_shutdown_writes * test/unit/test_server.rb -n test_client_shutdown_write_truncates * test/unit/test_server.rb -n test_client_malformed_body * test/unit/test_server.rb -n test_trickle_attack * test/unit/test_server.rb -n test_close_client * test/unit/test_server.rb -n test_bad_client * test/unit/test_server.rb -n test_logger_set * test/unit/test_server.rb -n test_logger_changed * test/unit/test_server.rb -n test_bad_client_400 * test/unit/test_server.rb -n test_http_0_9 * test/unit/test_server.rb -n test_header_is_too_long * test/unit/test_server.rb -n test_file_streamed_request * test/unit/test_server.rb -n test_file_streamed_request_bad_body * test/unit/test_server.rb -n test_listener_names * test/exec/test_exec.rb -n test_working_directory_rel_path_config_file * test/exec/test_exec.rb -n test_working_directory * test/exec/test_exec.rb -n test_working_directory_controls_relative_paths * test/exec/test_exec.rb -n test_exit_signals * test/exec/test_exec.rb -n test_basic * test/exec/test_exec.rb -n test_rack_env_unset * test/exec/test_exec.rb -n test_rack_env_cli_set * test/exec/test_exec.rb -n test_rack_env_ENV_set * test/exec/test_exec.rb -n test_rack_env_cli_override_ENV * test/exec/test_exec.rb -n test_ttin_ttou * test/exec/test_exec.rb -n test_help * test/exec/test_exec.rb -n test_broken_reexec_config * test/exec/test_exec.rb -n test_broken_reexec_ru * test/exec/test_exec.rb -n test_unicorn_config_listener_swap * test/exec/test_exec.rb -n test_unicorn_config_listen_with_options * test/exec/test_exec.rb -n test_unicorn_config_per_worker_listen * test/exec/test_exec.rb -n test_unicorn_config_listen_augments_cli * test/exec/test_exec.rb -n test_weird_config_settings * test/exec/test_exec.rb -n test_read_embedded_cli_switches * test/exec/test_exec.rb -n test_config_ru_alt_path * test/exec/test_exec.rb -n test_load_module * test/exec/test_exec.rb -n test_reexec * test/exec/test_exec.rb -n test_reexec_alt_config * test/exec/test_exec.rb -n test_socket_unlinked_restore * test/exec/test_exec.rb -n test_unicorn_config_file * test/exec/test_exec.rb -n test_daemonize_reexec * test/exec/test_exec.rb -n test_daemonize_redirect_fail * test/exec/test_exec.rb -n test_reexec_fd_leak * test/exec/test_exec.rb -n test_preload_app_hup * test/exec/test_exec.rb -n test_hup * test/exec/test_exec.rb -n test_default_listen_hup_holds_listener * test/exec/test_exec.rb -n test_default_listen_upgrade_holds_listener * test/unit/test_signals.rb -n test_worker_dies_on_dead_master * test/unit/test_signals.rb -n test_sleepy_kill * test/unit/test_signals.rb -n test_timeout_slow_response * test/unit/test_signals.rb -n test_response_write * test/unit/test_signals.rb -n test_request_read * test/unit/test_upload.rb -n test_put * test/unit/test_upload.rb -n test_put_content_md5 * test/unit/test_upload.rb -n test_put_trickle_small * test/unit/test_upload.rb -n test_put_keepalive_truncates_small_overwrite * test/unit/test_upload.rb -n test_put_excessive_overwrite_closed * test/unit/test_upload.rb -n test_uncomfortable_with_onenine_encodings * test/unit/test_upload.rb -n test_chunked_upload_via_curl * test/unit/test_upload.rb -n test_curl_chunked_small 179 tests, 63093 assertions, 0 failures, 0 errors bash-3.2$ On Fri, Jun 25, 2010 at 2:35 PM, Eric Wong wrote: > Andrew Milkowski wrote: >> Hi there, >> >> ran to a snag building unicorn from sources (git master at >> git://git.bogomips.org/unicorn.git) >> >> =A0 1) Failure: >> : test_working_directory_rel_path_config_file(ExecTest) >> [test/exec/test_exec.rb:106]: >> : <"/var/folders/gy/gyjECZCGGxKv3I3mRTmhB++++TI/-Tmp-/unicorn_exec_test2= 0100625-1679-1x3ks9d-0"> >> expected but was >> : <"/private/var/folders/gy/gyjECZCGGxKv3I3mRTmhB++++TI/-Tmp-/unicorn_ex= ec_test20100625-1679-1x3ks9d-0">. > > Hi Andrew, > > Not being an OSX user, I had to look this up, but apparently /var on OSX > is a symlink to /private/var? =A0Weird... > > We have to work around a similar issue for upgrades in Capistrano > deployments by updating ENV['PWD'], might as well do it here. > > I've just pushed out the following patch, which is a more thorough test > anyways: > > >From cf63db66bca9acfd3416ab8fc8a7fd4f07927342 Mon Sep 17 00:00:00 2001 > From: Eric Wong > Date: Fri, 25 Jun 2010 11:29:13 -0700 > Subject: [PATCH] test-exec: prefer ENV['PWD'] in working_directory tests > > We do an extra check in the application dispatch to ensure > ENV['PWD'] is set correctly to match Dir.pwd (even if the > string path is different) as this is required for Capistrano > deployments. > > These tests should now pass under OSX where /var is apparently > a symlink to /private/var. > --- > =A0test/exec/test_exec.rb | =A0 29 +++++++++++++++++------------ > =A01 files changed, 17 insertions(+), 12 deletions(-) > > diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb > index 9830683..1d24ca3 100644 > --- a/test/exec/test_exec.rb > +++ b/test/exec/test_exec.rb > @@ -54,6 +54,20 @@ before_fork do |server, worker| > =A0end > =A0 EOS > > + =A0WORKING_DIRECTORY_CHECK_RU =3D <<-EOS > +use Rack::ContentLength > +run lambda { |env| > + =A0pwd =3D ENV['PWD'] > + =A0a =3D ::File.stat(pwd) > + =A0b =3D ::File.stat(Dir.pwd) > + =A0if (a.ino =3D=3D b.ino && a.dev =3D=3D b.dev) > + =A0 =A0[ 200, { 'Content-Type' =3D> 'text/plain' }, [ pwd ] ] > + =A0else > + =A0 =A0[ 404, { 'Content-Type' =3D> 'text/plain' }, [] ] > + =A0end > +} > + =A0EOS > + > =A0 def setup > =A0 =A0 @pwd =3D Dir.pwd > =A0 =A0 @tmpfile =3D Tempfile.new('unicorn_exec_test') > @@ -87,10 +101,7 @@ end > =A0 =A0 File.unlink(other.path) > =A0 =A0 Dir.mkdir(other.path) > =A0 =A0 File.open("config.ru", "wb") do |fp| > - =A0 =A0 =A0fp.syswrite < -use Rack::ContentLength > -run proc { |env| [ 200, { 'Content-Type' =3D> 'text/plain' }, [ Dir.pwd = ] ] } > -EOF > + =A0 =A0 =A0fp.syswrite WORKING_DIRECTORY_CHECK_RU > =A0 =A0 end > =A0 =A0 FileUtils.cp("config.ru", other.path + "/config.ru") > =A0 =A0 Dir.chdir(@tmpdir) > @@ -138,10 +149,7 @@ EOF > =A0 =A0 File.unlink(other.path) > =A0 =A0 Dir.mkdir(other.path) > =A0 =A0 File.open("config.ru", "wb") do |fp| > - =A0 =A0 =A0fp.syswrite < -use Rack::ContentLength > -run proc { |env| [ 200, { 'Content-Type' =3D> 'text/plain' }, [ Dir.pwd = ] ] } > -EOF > + =A0 =A0 =A0fp.syswrite WORKING_DIRECTORY_CHECK_RU > =A0 =A0 end > =A0 =A0 FileUtils.cp("config.ru", other.path + "/config.ru") > =A0 =A0 tmp =3D Tempfile.new('unicorn.config') > @@ -177,10 +185,7 @@ EOF > =A0 =A0 File.unlink(other.path) > =A0 =A0 Dir.mkdir(other.path) > =A0 =A0 File.open("config.ru", "wb") do |fp| > - =A0 =A0 =A0fp.syswrite < -use Rack::ContentLength > -run proc { |env| [ 200, { 'Content-Type' =3D> 'text/plain' }, [ Dir.pwd = ] ] } > -EOF > + =A0 =A0 =A0fp.syswrite WORKING_DIRECTORY_CHECK_RU > =A0 =A0 end > =A0 =A0 FileUtils.cp("config.ru", other.path + "/config.ru") > =A0 =A0 system('mkfifo', "#{other.path}/fifo") > -- > Eric Wong > _______________________________________________ > 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 > _______________________________________________ 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