Closed #646. ``

To reproduce test failure on master you can change it like this (it still might 
not fail, but after 5-6 runs usually does):

{{{
     # set up for test
     from random import choice
     setup_trove_categories()
-    random_trove = choice(M.TroveCategory.query.find().all())
+    random_trove = choice(M.TroveCategory.query.find({'shortname': 
'lppl'}).all())
}}}

Make sure that it is not failing on a branch (with given change).

Also, created a script to remove duplicates if they present in db. It's a bit 
tricky, so make sure you run it with `--dry-run` first, to understand what will 
be done. Unfortunately, re-running `create_trove_categories` to re-generate 
categories will remove categories from all existing projects (since all 
categories would get new ids), so we need that script.

Actually, I don't sure why project -> category relationship depends on 
`ObjectId`s, when  categories have a natural unique id (cat_id + parent_id). 
Maybe we need to refactor it someday. :)


---

** [tickets:#7628] test_filtering fails occasionally**

**Status:** in-progress
**Milestone:** forge-sep-5
**Created:** Tue Aug 19, 2014 08:03 PM UTC by Dave Brondsema
**Last Updated:** Fri Aug 29, 2014 07:44 AM UTC
**Owner:** Igor Bondarenko

`allura/tests/test_globals.py:test_filtering` fails sometimes.  It randomly 
picks a trove category to use for the test, and some trove categories are in 
the test data twice, so the lookup fails.  It seems that in 
`allura/command/create_trove_categories.py` the `m__add_agpl_and_lppl` method 
creates TroveCategories that already exist in the main `command` method.


---

Sent from sourceforge.net because [email protected] is subscribed to 
https://sourceforge.net/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/allura/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.

Reply via email to