jiahuili430 commented on code in PR #5341:
URL: https://github.com/apache/couchdb/pull/5341#discussion_r1854797911


##########
src/mango/test/16-index-selectors-test.py:
##########
@@ -189,6 +189,7 @@ def 
test_uses_partial_index_with_non_indexable_selector(self):
 @unittest.skipUnless(mango.has_text_service(), "requires text service")
 class IndexSelectorText(mango.DbPerClass):
     def setUp(self):
+        self.db = 
mango.Database(f"{mango.random_db_name()}_{str(self).split()[0]}")

Review Comment:
   If using the same db name, `0.13` is the shortest time I need to avoid `500` 
locally.
   This approach also increased the overall Mango test time to `60.730s`, 
compared to `49.936s` using custom database name.
   
   ```diff
   def recreate(self):
   -    NUM_TRIES = 10
   +    NUM_TRIES = 3
   
   -    for k in range(NUM_TRIES):
   +    for k in range(1, NUM_TRIES):
            r = self.sess.get(self.url)
            if r.status_code == 200:
                db_info = r.json()
                docs = db_info["doc_count"] + db_info["doc_del_count"]
                    if docs == 0:
                        # db exists and it is empty -- exit condition is met
                        return
                    self.delete()
   +        time.sleep(k * 0.13)
            self.create()
   -        time.sleep(k * 0.1)
        raise Exception(
            "Failed to recreate the database after {} tries".format(NUM_TRIES)
        )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to