<div dir="ltr">Hi Przemyslaw,<div><br></div><div>Thanks for bringing up the topic. A long time ago we had similar topic,</div><div>I agree that the way it works now is not good at all, because it leads to</div><div>a lot of problems, I remember the time when our tests were randomly</div><div>broken because of deadlocks and race conditions with fake thread.</div><div><br></div><div>We should write some helpers for receiver module, to explicitly and easily</div><div>change state of the system, as you mentioned it should be done in</div><div><span style="font-size:12.8000001907349px">synchronous fashion.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">But of course we cannot just remove fake and we should continue supporting</span></div><div><span style="font-size:12.8000001907349px">it, some fake thread specific tests should be added to make sure that </span><span style="font-size:12.8000001907349px">it's not</span></div><div><span style="font-size:12.8000001907349px">broken.</span></div><div><br></div><div>Thanks,</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 16, 2015 at 2:54 PM, Przemyslaw Kaminski <span dir="ltr"><<a href="mailto:pkaminski@mirantis.com" target="_blank">pkaminski@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
This somehow relates to [1]: in integration tests we have a class<br>
called FakeThread. It is responsible for spawning threads to simulate<br>
asynchronous tasks in fake env. In BaseIntegrationTest class we have a<br>
method called _wait_for_threads that waits for all fake threads to<br>
terminate.<br>
<br>
In my understanding what these things actually do is that they just<br>
simulate Astute's responses. I'm thinking if this could be replaced by<br>
a better solution, I just want to start a discussion on the topic.<br>
<br>
My suggestion is to get rid of all this stuff and implement a<br>
predictable solution: something along promises or coroutines that<br>
would execute synchronously. With either promises or coroutines we<br>
could simulate tasks responses any way we want without the need to<br>
wait using unpredictable stuff like sleeping, threading and such. No<br>
need for waiting or killing threads. It would hopefully make our tests<br>
easier to debug and get rid of the random errors that are sometimes<br>
getting into our master branch.<br>
<br>
P.<br>
<br>
[1] <a href="https://bugs.launchpad.net/fuel/+bug/1421599" target="_blank">https://bugs.launchpad.net/fuel/+bug/1421599</a><br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><br></div>