[Wok][RFC] #160: Fedora 25: Make check breaks on wok

Issue: make check on Fedora 25 returns error: ====================================================================== FAIL: test_object_store_threaded (test_objectstore.ObjectStoreTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_objectstore.py", line 105, in test_object_store_threaded self.assertEquals(10, len(store._connections.keys())) AssertionError: 10 != 2 Error: tests/test_objectstore isn't able to deal with function session.store Propose: As i saw, the issue is in this function: def test_object_store_threaded(self): def worker(ident): with store as session: session.store('foo', ident, {}) store = objectstore.ObjectStore(tmpfile) threads = [] for i in range(50): t = threading.Thread(target=worker, args=(i,)) t.setDaemon(True) t.start() threads.append(t) for t in threads: t.join(0) with store as session: self.assertEquals(50, len(session.get_list('foo'))) self.assertEquals(10, len(store._connections.keys())) 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? -- Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com

daniel helped me to debug the issue and found that threading ident was the problem On 01/13/2017 04:47 PM, Ramon Medeiros wrote:
Issue: make check on Fedora 25 returns error:
====================================================================== FAIL: test_object_store_threaded (test_objectstore.ObjectStoreTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_objectstore.py", line 105, in test_object_store_threaded self.assertEquals(10, len(store._connections.keys())) AssertionError: 10 != 2
Error:
tests/test_objectstore isn't able to deal with function session.store
Propose: As i saw, the issue is in this function:
def test_object_store_threaded(self): def worker(ident): with store as session: session.store('foo', ident, {})
store = objectstore.ObjectStore(tmpfile)
threads = [] for i in range(50): t = threading.Thread(target=worker, args=(i,)) t.setDaemon(True) t.start() threads.append(t)
for t in threads: t.join(0)
with store as session: self.assertEquals(50, len(session.get_list('foo'))) self.assertEquals(10, len(store._connections.keys()))
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? --
Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
-- Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com
participants (1)
-
Ramon Medeiros