Skip to content

Commit

Permalink
Merge pull request #1308 from mikedh/fix/flaky
Browse files Browse the repository at this point in the history
Followup: Remove flakey timing tests
  • Loading branch information
mikedh committed Aug 4, 2021
2 parents 1238e0b + ccbad4b commit a6f29b7
Showing 1 changed file with 9 additions and 27 deletions.
36 changes: 9 additions & 27 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ def test_hash(self):

count = 10000

mt = g.timeit.timeit(setup=setup,
stmt='t._modified_m=True;t.md5()',
number=count)
ct = g.timeit.timeit(setup=setup,
stmt='t._modified_c=True;t.crc()',
number=count)
xt = g.timeit.timeit(setup=setup,
stmt='t._modified_x=True;t.fast_hash()',
number=count)
g.timeit.timeit(setup=setup,
stmt='t._modified_m=True;t.md5()',
number=count)
g.timeit.timeit(setup=setup,
stmt='t._modified_c=True;t.crc()',
number=count)
g.timeit.timeit(setup=setup,
stmt='t._modified_x=True;t.fast_hash()',
number=count)

m = g.get_mesh('featuretype.STL')
# log result values
Expand All @@ -32,24 +32,6 @@ def test_hash(self):
m.vertices.crc(),
m.vertices.fast_hash()))

# crc should always be faster than MD5
g.log.info('\nTime\nMD5:\n{}\nCRC:\n{}\nXX:\n{}'.format(
mt, ct, xt))

# CRC should be faster than MD5
# this is NOT true if you blindly call adler32
# but our speed check on import should assure this
assert ct < mt

# xxhash should be faster than CRC and MD5
# it is sometimes slower on Windows/Appveyor TODO: figure out why
try:
import xxhash # NOQA
except BaseException:
return
assert xt < mt
assert xt < ct

def test_track(self):
"""
Check to make sure our fancy caching system only changes
Expand Down

0 comments on commit a6f29b7

Please sign in to comment.