<?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: New Rails Isolation Testing</title>
	<atom:link href="http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/</link>
	<description>Random Geek-Related Thoughts</description>
	<lastBuildDate>Wed, 08 Sep 2010 23:53:11 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ben</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-17116</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Tue, 08 Sep 2009 05:51:20 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-17116</guid>
		<description>@Ted, this isn&#039;t about parallelization.  It&#039;s just that some tests modify global state which can be hard/impossible to undo without restarting the VM.  This isolation allows those things to occur, be examined, and then be completely discarded at the OS level.</description>
		<content:encoded><![CDATA[<p>@Ted, this isn&#8217;t about parallelization.  It&#8217;s just that some tests modify global state which can be hard/impossible to undo without restarting the VM.  This isolation allows those things to occur, be examined, and then be completely discarded at the OS level.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-16912</link>
		<dc:creator>Ted</dc:creator>
		<pubDate>Thu, 30 Jul 2009 11:48:34 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-16912</guid>
		<description>Wouldn&#039;t this be susceptible to  race conditions at the database level?  If one test has an assert_difference and expects X records to be created, but simultaneously another test runs that creates records in the same table, you&#039;d have a false positive.  Or is each test inherently wrapped in a transaction (in which case parallelizing them would seem to provide a negligible benefit)?  Thanks.</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t this be susceptible to  race conditions at the database level?  If one test has an assert_difference and expects X records to be created, but simultaneously another test runs that creates records in the same table, you&#8217;d have a false positive.  Or is each test inherently wrapped in a transaction (in which case parallelizing them would seem to provide a negligible benefit)?  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Woolley</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-16663</link>
		<dc:creator>Chad Woolley</dc:creator>
		<pubDate>Wed, 01 Jul 2009 17:59:59 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-16663</guid>
		<description>What about debugging?  Will this mess with call stacks, breakpoints or stepping through test code or environment code during tests?  That is, do most current debuggers (ruby-debug, rubymine, etc) handle forking OK?</description>
		<content:encoded><![CDATA[<p>What about debugging?  Will this mess with call stacks, breakpoints or stepping through test code or environment code during tests?  That is, do most current debuggers (ruby-debug, rubymine, etc) handle forking OK?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wycats</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-16662</link>
		<dc:creator>wycats</dc:creator>
		<pubDate>Wed, 01 Jul 2009 17:41:09 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-16662</guid>
		<description>@dan interestingly, the Merb tests were much more primitive than what we&#039;ve done here. In this case, the parent literally doesn&#039;t know that the tests are being run in forks; everything that happens in the child (in terms of collecting stats) is simply replayed in the parent. In Merb, we massively subverted the test runner ;)</description>
		<content:encoded><![CDATA[<p>@dan interestingly, the Merb tests were much more primitive than what we&#8217;ve done here. In this case, the parent literally doesn&#8217;t know that the tests are being run in forks; everything that happens in the child (in terms of collecting stats) is simply replayed in the parent. In Merb, we massively subverted the test runner ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wycats</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-16661</link>
		<dc:creator>wycats</dc:creator>
		<pubDate>Wed, 01 Jul 2009 17:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-16661</guid>
		<description>@chad on the contrary! Because we&#039;re isolating just the running of the test inside the fork, it means we can do far more invasive things inside the test itself, but not have to start up the full environment each time. Unfortunately, this approach doesn&#039;t work on Windows, so Windows tests would indeed be slower, but that should impact your scenario, which is development-time test.

In effect, you get roughly the same speed as running the tests in a single process (with the extra overhead of forking, which is quite small), but all the benefits of running tests in isolation.</description>
		<content:encoded><![CDATA[<p>@chad on the contrary! Because we&#8217;re isolating just the running of the test inside the fork, it means we can do far more invasive things inside the test itself, but not have to start up the full environment each time. Unfortunately, this approach doesn&#8217;t work on Windows, so Windows tests would indeed be slower, but that should impact your scenario, which is development-time test.</p>
<p>In effect, you get roughly the same speed as running the tests in a single process (with the extra overhead of forking, which is quite small), but all the benefits of running tests in isolation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Mayer</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-16660</link>
		<dc:creator>Dan Mayer</dc:creator>
		<pubDate>Wed, 01 Jul 2009 17:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-16660</guid>
		<description>I know that Merb does forking for tests in one of their suites as well as that caused us to have to support test isolation for Devver. It wasn&#039;t that hard of a feature but it sure through me for a loop trying to dig in and see why the tests were behaving so different locally or on devver. Kind of nice to keep things isolated though.</description>
		<content:encoded><![CDATA[<p>I know that Merb does forking for tests in one of their suites as well as that caused us to have to support test isolation for Devver. It wasn&#8217;t that hard of a feature but it sure through me for a loop trying to dig in and see why the tests were behaving so different locally or on devver. Kind of nice to keep things isolated though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Avdi</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-16659</link>
		<dc:creator>Avdi</dc:creator>
		<pubDate>Wed, 01 Jul 2009 16:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-16659</guid>
		<description>I&#039;ve done something similar with forking to isolate tests.  I&#039;m curious how you handles the communication back to the parent process?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve done something similar with forking to isolate tests.  I&#8217;m curious how you handles the communication back to the parent process?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Woolley</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-16658</link>
		<dc:creator>Chad Woolley</dc:creator>
		<pubDate>Wed, 01 Jul 2009 16:28:56 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-16658</guid>
		<description>Does this slow things down any more?  One of the biggest headaches we have is slow individual test startup time.  In a Rails project that has many plugins/gems/dependencies and a complex environment, running a *single* test can take up to 15+ seconds - all environment initialization.

This completely kills the TDD red-green-refactor flow of a pair.

There are several ways people try to get around this.  Some people use tools that keep the environment spun up (e.g. spec server or autotest) - this is a pain, because you always have situations where tests are failing falsely due to stale state, and you have to manually restart.  Other people go to great lengths to lazily initialize and defer everything in their environment, so less stuff gets loaded during most tests.  This also takes a lot of careful thought and work. 

Does your approach of new process creation for every test exacerbate this problem?  What other thoughts do you have on this topic?

Thanks,
-- Chad</description>
		<content:encoded><![CDATA[<p>Does this slow things down any more?  One of the biggest headaches we have is slow individual test startup time.  In a Rails project that has many plugins/gems/dependencies and a complex environment, running a *single* test can take up to 15+ seconds &#8211; all environment initialization.</p>
<p>This completely kills the TDD red-green-refactor flow of a pair.</p>
<p>There are several ways people try to get around this.  Some people use tools that keep the environment spun up (e.g. spec server or autotest) &#8211; this is a pain, because you always have situations where tests are failing falsely due to stale state, and you have to manually restart.  Other people go to great lengths to lazily initialize and defer everything in their environment, so less stuff gets loaded during most tests.  This also takes a lot of careful thought and work. </p>
<p>Does your approach of new process creation for every test exacerbate this problem?  What other thoughts do you have on this topic?</p>
<p>Thanks,<br />
&#8211; Chad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yehuda Katz</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-16657</link>
		<dc:creator>Yehuda Katz</dc:creator>
		<pubDate>Wed, 01 Jul 2009 16:12:55 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-16657</guid>
		<description>It just means that Carl and I have started actively using edge for projects, and don&#039;t want to see &quot;Starting Rails 2.3&quot; every time we boot our apps ;)

The best way to gauge how close we are to a public beta is to keep watching these posts (and posts we&#039;re going to start doing on the RoR blog).</description>
		<content:encoded><![CDATA[<p>It just means that Carl and I have started actively using edge for projects, and don&#8217;t want to see &#8220;Starting Rails 2.3&#8243; every time we boot our apps ;)</p>
<p>The best way to gauge how close we are to a public beta is to keep watching these posts (and posts we&#8217;re going to start doing on the RoR blog).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lolcatz</title>
		<link>http://yehudakatz.com/2009/07/01/new-rails-isolation-testing/comment-page-1/#comment-16655</link>
		<dc:creator>lolcatz</dc:creator>
		<pubDate>Wed, 01 Jul 2009 10:46:17 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=282#comment-16655</guid>
		<description>thanks for a nice write-up!

i also noticed that you bumped rails version to 3.0pre.
does it mean that something like beta will be out in the nearest months?</description>
		<content:encoded><![CDATA[<p>thanks for a nice write-up!</p>
<p>i also noticed that you bumped rails version to 3.0pre.<br />
does it mean that something like beta will be out in the nearest months?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
