<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Marcel, thanks for your points! :-) I think the coverage detection should work with hard-coded priorities, too. There are just too many users that don't respect Processor activePriority etc.</p>
<p><br>
</p>
<p>Hm ... Speaking hypothetically, couldn't we check Processor activeProcess in every single TestCoverage, i.e.:</p>
<p>- Register the testing process when creating a coverage wrapper</p>
<p>- Only #mark the method if Processor activeProcess equals the testing process or a child of it?</p>
<p><br>
</p>
<p>Then we could get completely rid of global state and you should be able to run coverage testing completely asynchronously (for example in AutoTDD)! :-)</p>
<p>However, this could slow down coverage testing significantly, I did not yet try it out ...</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">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Montag, 20. April 2020 19:01:15<br>
<b>An:</b> gettimothy via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] [Question/Bug] SUnit CodeCoverage uses #valueUnpreemptively</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hi Christoph,
<div><br>
</div>
<div>I would only start collecting coverage for tests that run fine in the first place. And if I would collect coverage, I want to get reliable numbers -- if that's even possible when speaking of "coverage" at all. :-D ... Anyway, higher-level processes could
 largely interfere with the results without you knowing it. Results could change just by re-running coverage, which would be bad.</div>
<div><br>
</div>
<div>Maybe one could bump the "user interrupt watcher" from 60 to 81 while running those coverage tests? To make CMD+Dot work ...</div>
<div><br>
</div>
<div>Hmm... you can also not run coverage on tests that rely on other processes to finish unless those processes have a priority relative to the current one and not hard-coded via "Processor userBackgroundPriority" etc. Those are fixed.</div>
<div><br>
</div>
<div>Just my thoughts on this topic.</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 09.04.2020 15:33:23 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<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;min-width: 500px">
<p><span><span></span></span></p>
<blockquote style="margin: 0px 0px 0px 40px;border: none;padding: 0px;min-width: 500px">
<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;min-width: 500px">
<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;min-width: 500px">
<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;min-width: 500px">
<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;min-width: 500px">
<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;min-width: 500px">
<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;min-width: 500px">
<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;min-width: 500px">
<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;min-width: 500px">
<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;min-width: 500px">
<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"><span style="font-family: 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>
</span></div>
</div>
</div>
</div>
</div>
<div><span style="font-size: 10pt;color: #808080"></span></div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>