<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>daniel helped me to debug the issue and found that threading
      ident was the problem <br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 01/13/2017 04:47 PM, Ramon Medeiros
      wrote:<br>
    </div>
    <blockquote
      cite="mid:0cf791e2-9b34-5b35-9421-b5ade48f695a@linux.vnet.ibm.com"
      type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <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 &amp; Technology Group
Phone : +55 19 2132 7878
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:ramonn@br.ibm.com">ramonn@br.ibm.com</a> </pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 

Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems &amp; 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>