itkach / slob

Data store for Aard 2
GNU General Public License v3.0
241 stars 32 forks source link

fix flaky test caused by random iteration over set in _resolve_aliases #50

Closed ilius closed 6 months ago

ilius commented 6 months ago

This test is sometimes failing. Like 1 in 5 to 7 times in average.

FAIL: test_alias (slob.TestAlias)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/slob/slob.py", line 1638, in test_alias
    self.assertEqual(item_g1.fragment, "")
AssertionError: 'g-frag1' != ''
- g-frag1
+ 

I think it's because iteration order over set is random. This PR fixes it.