<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Issue: <br>
make check on Fedora 25 returns error:</p>
<p>======================================================================<br>
FAIL: test_object_store_threaded
(test_objectstore.ObjectStoreTests)<br>
----------------------------------------------------------------------<br>
Traceback (most recent call last):<br>
File "test_objectstore.py", line 105, in
test_object_store_threaded<br>
self.assertEquals(10, len(store._connections.keys()))<br>
AssertionError: 10 != 2<br>
<br>
Error:<br>
</p>
tests/test_objectstore isn't able to deal with function
session.store<br>
<br>
Propose:<br>
As i saw, the issue is in this function:<br>
<br>
def test_object_store_threaded(self):<br>
def worker(ident):<br>
with store as session:<br>
session.store('foo', ident, {})<br>
<br>
store = objectstore.ObjectStore(tmpfile)<br>
<br>
threads = []<br>
for i in range(50):<br>
t = threading.Thread(target=worker, args=(i,))<br>
t.setDaemon(True)<br>
t.start()<br>
threads.append(t)<br>
<br>
for t in threads:<br>
t.join(0)<br>
<br>
with store as session:<br>
self.assertEquals(50, len(session.get_list('foo')))<br>
self.assertEquals(10, len(store._connections.keys()))<br>
<br>
<br>
If a time.sleep is added to worker(), the issue is solved. So, store
cannot handle too much tries, what happens at the first looping. As
using sleep is too ugly, how can i improve the bug fix?<br>
<pre class="moz-signature" cols="72">--
Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
<a class="moz-txt-link-abbreviated" href="mailto:ramonn@br.ibm.com">ramonn@br.ibm.com</a> </pre>
</body>
</html>