qa/tasks/mds_thrash: fix thrash iteration never skip

Signed-off-by: Lianne <liyan.wang@xtaotech.com>
This commit is contained in:
Lianne 2021-05-24 17:17:44 +08:00
parent 26b01013e9
commit 2b50cefa89

View File

@ -272,7 +272,7 @@ class MDSThrasher(Thrasher, Greenlet):
weight = 1.0
if 'thrash_weights' in self.config:
weight = self.config['thrash_weights'].get(label, '0.0')
skip = random.randrange(0.0, 1.0)
skip = random.random()
if weight <= skip:
self.log('skipping thrash iteration with skip ({skip}) > weight ({weight})'.format(skip=skip, weight=weight))
continue