https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112011-08-17T14:45:15ZRuby Issue Tracking SystemRuby master - Bug #5197: at_exit order has changed in 1.9.3dev32413https://redmine.ruby-lang.org/issues/5197?journal_id=203092011-08-17T14:45:15Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul></ul><p>Hi Ryan,</p>
<p>Can you please see following discussion at first?</p>
<p><a href="http://redmine.ruby-lang.org/issues/4400" class="external">http://redmine.ruby-lang.org/issues/4400</a></p>
<p>And then, can you please explain why you are unhappy? Now at_exit() is consistent with JRuby and MacRuby. Then, fixing your unhappiness need to change three Ruby implementation at least.</p>
<p>Thanks.</p> Ruby master - Bug #5197: at_exit order has changed in 1.9.3dev32413https://redmine.ruby-lang.org/issues/5197?journal_id=204212011-08-26T20:40:37Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li><li><strong>Assignee</strong> set to <i>zenspider (Ryan Davis)</i></li></ul> Ruby master - Bug #5197: at_exit order has changed in 1.9.3dev32413https://redmine.ruby-lang.org/issues/5197?journal_id=206892011-09-09T10:25:52Zzenspider (Ryan Davis)
<ul><li><strong>Assignee</strong> changed from <i>zenspider (Ryan Davis)</i> to <i>kosaki (Motohiro KOSAKI)</i></li></ul><p>That discussion makes my head hurt.</p>
<p>What I need is this:</p>
<ol>
<li>
<p>minitest, like test/unit before it, runs its tests via at_exit.</p>
</li>
<li>
<p>Users need to be able to register code to run AFTER the tests run (for extra reporting, or resource cleanup). This was usually done with:</p>
<p>at_exit { at_exit { codes } }</p>
</li>
</ol>
<p>which I wrapped up in a method called #after_tests(&b).</p>
<p>Now that doesn't work. I need some mechanism to make this work as its been available this way for 10+ years. I don't care what mechanism I wind up using, as long as it works.</p>
<p>See <a href="https://github.com/seattlerb/minitest/issues/25" class="external">https://github.com/seattlerb/minitest/issues/25</a> for more info.</p> Ruby master - Bug #5197: at_exit order has changed in 1.9.3dev32413https://redmine.ruby-lang.org/issues/5197?journal_id=207222011-09-10T21:07:53Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Rejected</i></li></ul><blockquote>
<p>What I need is this:</p>
<ol>
<li>
<p>minitest, like test/unit before it, runs its tests via at_exit.</p>
</li>
<li>
<p>Users need to be able to register code to run AFTER the tests run (for extra reporting, or > resource cleanup). This was usually done with:</p>
<p>at_exit { at_exit { codes } }</p>
</li>
</ol>
</blockquote>
<p>Yeah, It's clearly bad code.</p>
<p>quote from <a href="https://blade.ruby-lang.org/ruby-core/35254">[ruby-core:35254]</a>. Matz wrote,</p>
<blockquote>
<p>OK, I choose C's behavior. Although I don't recommend to rely too<br>
much on the atexit order. Motohiro, could you check in?</p>
</blockquote>
<p>I'm stand aside matz. don't do that.</p>
<blockquote>
<p>which I wrapped up in a method called #after_tests(&b).</p>
<p>Now that doesn't work.</p>
</blockquote>
<p>Not now. It has been broken long time.<br>
Even if I revert MRI change, It doesn't work on other ruby implementation.</p>
<p>So, I don't understand why we need revert the code even if it doesn't solve the problem.</p>
<blockquote>
<p>I need some mechanism to make this work as its been available this way for 10+ years.<br>
I don't care what mechanism I wind up using, as long as it works.</p>
</blockquote>
<p>I pity the 10+ years broken code.<br>
And one correction. This behavior was introduced following commit. see date.</p>
<hr>
<p>commit a3e1b1ce7ed7e7ffac23015fc2fde56511b30681<br>
Author: ko1 <a href="mailto:ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e" class="email">ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</a><br>
Date: Sun Dec 31 15:02:22 2006 +0000</p>
<pre><code> * Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</code></pre>
<p>Last of all.<br>
But, as far as that a revert solve a issue, I'd like to choose a revert. Please remember it.</p>
<p>Thanks.</p>