<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p>Hi all,</p>
<p><br>
</p>
<p>I have a question regarding to the implementation of TestRunner >> #<span>collectCoverageFor:. Why does it use #<span>valueUnpreemptively during running the coverage tests?</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span></span></span></p>
<p>I found two major disadvantages of using #valueUnpreemptively in the TestRunner:</p>
<p><br>
</p>
<p></p>
<ol style="margin-bottom:0px; margin-top:0px">
<li>
<p><span style="font-size:12pt">You cannot interrupt the system via cmd+dot if you lose your patience to wait for all tests to complete.</span><br>
</p>
</li><li>
<p><span style="font-size:12pt">In addition, I found a quite interesting bug that makes your image unusable if you do the following:<br>
<br>
</span></p>
</li></ol>
<p></p>
<p></p>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px">
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<div>TestCase subclass: #MyTestCase</div>
</blockquote>
<p></p>
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<div><span style="white-space:pre"></span>instanceVariableNames: ''</div>
</blockquote>
<p></p>
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<div><span style="white-space:pre"></span>classVariableNames: ''</div>
</blockquote>
<p></p>
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<div><span style="white-space:pre"></span>poolDictionaries: ''</div>
</blockquote>
<p></p>
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<div><span style="white-space:pre"></span>category: 'UserObjects'.</div>
</blockquote>
<p></p>
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<div>MyTestCase compile: 'testTimeout</div>
</blockquote>
<p></p>
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<div><span style="white-space:pre"></span>[] repeat'.</div>
</blockquote>
<p></p>
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<div><span style="font-size:12pt">TestRunner openForSuite: MyTestCase suite.</span></div>
</blockquote>
<p></p>
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<div><span style="font-size:12pt">"Now press 'Run coverage' abd choose any non-empty package."</span></div>
</blockquote>
<span style="font-size:12pt">
<p><span style="font-size:12pt"><br>
</span></p>
The coverage test will never end!</span><span><span><br>
</span></span>
<p></p>
</blockquote>
<p><span><span></span></span></p>
<blockquote style="margin:0px 0px 0px 40px; border:none; padding:0px">
<p></p>
<div></div>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
</blockquote>
<div><br>
</div>
<div>#valueUnpreemptively's comment says that you should use it very carefully, what makes absolutely sense to me, and it has only two senders in the Trunk at all (the second one is ClassBuilder >> #update:to:).<br>
</div>
<p></p>
<p>Why should it be necessary to use it in the TestRunner? Because we replace CompiledMethods? That's nothing WrappedBreakpoint wouldn't do, too. I replaced #valueUnpreemptively in this method by a normal #value in my image and the world did not end - thanks
 to dynamic forwarding, I could even keep browsing the patched methods. However, I admit it would not be a good idea to recompile any method during the coverage tests are running. (We could also use some property like Class >> #beLocked to avoid this, hypothetically).</p>
<p><br>
</p>
<p>I am looking forward to your advice.</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
</body>
</html>