<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Speeding up Paperclip Tests by&#8230; a&#160;LOT</title>
	<atom:link href="http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/feed/" rel="self" type="application/rss+xml" />
	<link>http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/</link>
	<description></description>
	<lastBuildDate>Wed, 10 Mar 2010 01:15:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Trevor</title>
		<link>http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/comment-page-1/#comment-69098</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Fri, 06 Nov 2009 20:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1218#comment-69098</guid>
		<description>Cool - thanks for the feedback!</description>
		<content:encoded><![CDATA[<p>Cool &#8211; thanks for the feedback!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Madsen</title>
		<link>http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/comment-page-1/#comment-69096</link>
		<dc:creator>Steve Madsen</dc:creator>
		<pubDate>Fri, 06 Nov 2009 14:32:11 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1218#comment-69096</guid>
		<description>Based on my debugging, it appears so, but I&#039;m also using very small files for these tests. Any additional overhead in save_attached_files is not impacting the test run time, and it is allowing Paperclip to clean up the temporary files it creates.

A slow test is a problem, but failing due to a problem outside my code is worse. :-)</description>
		<content:encoded><![CDATA[<p>Based on my debugging, it appears so, but I&#8217;m also using very small files for these tests. Any additional overhead in save_attached_files is not impacting the test run time, and it is allowing Paperclip to clean up the temporary files it creates.</p>
<p>A slow test is a problem, but failing due to a problem outside my code is worse. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/comment-page-1/#comment-69094</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Fri, 06 Nov 2009 05:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1218#comment-69094</guid>
		<description>Steve, so you&#039;re saying it&#039;s best to just stub out the &quot;post_process&quot; method? I suppose that would at least save all the time for generating thumbnails...</description>
		<content:encoded><![CDATA[<p>Steve, so you&#8217;re saying it&#8217;s best to just stub out the &#8220;post_process&#8221; method? I suppose that would at least save all the time for generating thumbnails&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Madsen</title>
		<link>http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/comment-page-1/#comment-69093</link>
		<dc:creator>Steve Madsen</dc:creator>
		<pubDate>Fri, 06 Nov 2009 04:37:31 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1218#comment-69093</guid>
		<description>This technique has worked really well for me for a couple of months now, until tonight. I accumulated enough functional tests with stubbed out Paperclip methods that I hit too many open files and my tests started failing inside Paperclip:

Errno::EMFILE: Too many open files - /var/folders/45/45kdBsmpGF0A-mb8hYDQxU+++TM/-Tmp-/stream.25027.213
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tempfile.rb:55:in `initialize&#039;
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tempfile.rb:55:in `open&#039;
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tempfile.rb:55:in `initialize&#039;
    vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/iostream.rb:7:in `new&#039;
    vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/iostream.rb:7:in `to_tempfile&#039;
    vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:79:in `assign&#039;
    vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip.rb:232:in `image=&#039;

The solution seems to be to NOT stub out save_attached_files and delete_attached_files, and it doesn&#039;t impact the run time of the tests, either.</description>
		<content:encoded><![CDATA[<p>This technique has worked really well for me for a couple of months now, until tonight. I accumulated enough functional tests with stubbed out Paperclip methods that I hit too many open files and my tests started failing inside Paperclip:</p>
<p>Errno::EMFILE: Too many open files &#8211; /var/folders/45/45kdBsmpGF0A-mb8hYDQxU+++TM/-Tmp-/stream.25027.213<br />
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tempfile.rb:55:in `initialize&#8217;<br />
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tempfile.rb:55:in `open&#8217;<br />
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tempfile.rb:55:in `initialize&#8217;<br />
    vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/iostream.rb:7:in `new&#8217;<br />
    vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/iostream.rb:7:in `to_tempfile&#8217;<br />
    vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:79:in `assign&#8217;<br />
    vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip.rb:232:in `image=&#8217;</p>
<p>The solution seems to be to NOT stub out save_attached_files and delete_attached_files, and it doesn&#8217;t impact the run time of the tests, either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xavius</title>
		<link>http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/comment-page-1/#comment-68940</link>
		<dc:creator>Xavius</dc:creator>
		<pubDate>Mon, 24 Aug 2009 16:37:41 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1218#comment-68940</guid>
		<description>Trevor, would you be able to include another posts with some basics on how to use Test::Unit to create functional tests for controllers associated with paperclip models?</description>
		<content:encoded><![CDATA[<p>Trevor, would you be able to include another posts with some basics on how to use Test::Unit to create functional tests for controllers associated with paperclip models?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodney</title>
		<link>http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/comment-page-1/#comment-68661</link>
		<dc:creator>Rodney</dc:creator>
		<pubDate>Thu, 07 May 2009 23:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1218#comment-68661</guid>
		<description>Thanks for posting that!  I don&#039;t know if it&#039;s my version of paperclip, but I have to use :destroy_attached_files, instead.

Photo.any_instance.stubs(:delete_attached_files).returns(true)</description>
		<content:encoded><![CDATA[<p>Thanks for posting that!  I don&#8217;t know if it&#8217;s my version of paperclip, but I have to use :destroy_attached_files, instead.</p>
<p>Photo.any_instance.stubs(:delete_attached_files).returns(true)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dev Blog AF83 &#187; Blog Archive &#187; Veille technologique : Navigateurs web, Subversion, Javascript, Frameworks, Tests unitaires, Méthodes, Logiciel Libre</title>
		<link>http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/comment-page-1/#comment-68599</link>
		<dc:creator>Dev Blog AF83 &#187; Blog Archive &#187; Veille technologique : Navigateurs web, Subversion, Javascript, Frameworks, Tests unitaires, Méthodes, Logiciel Libre</dc:creator>
		<pubDate>Mon, 16 Mar 2009 17:43:48 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1218#comment-68599</guid>
		<description>[...] http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/ : une technique pour accélérer les tests unitaires en présence de paperclip [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/" rel="nofollow">http://almosteffortless.com/2009/03/12/speeding-up-paperclip-tests-by-a-lot/</a> : une technique pour accélérer les tests unitaires en présence de paperclip [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
