Changeset 84893 in vbox for trunk/src/VBox/ValidationKit/testdriver
- Timestamp:
- Jun 22, 2020 11:06:48 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/testfileset.py
r83623 r84893 618 618 return self.aoFiles[self.oRandom.choice(xrange(len(self.aoFiles)))]; 619 619 620 def chooseRandomDirFromTree(self, fLeaf = False, fNonEmpty = False ):620 def chooseRandomDirFromTree(self, fLeaf = False, fNonEmpty = False, cMaxRetries = 1024): 621 621 """ 622 622 Returns a random directory from the tree (self.oTreeDir). 623 623 """ 624 while True: 624 cRetries = 0; 625 while cRetries < cMaxRetries: 625 626 oDir = self.aoDirs[self.oRandom.choice(xrange(len(self.aoDirs)))]; 626 627 # Check fNonEmpty requirement: … … 638 639 return oDir; 639 640 oParent = oParent.oParent; 641 cRetries++; 642 643 reporter.errorXcpt('chooseRandomDirFromTree() failed; cMaxRetries=%d' % (cMaxRetries)); 640 644 return None; # make pylint happy 641 645
Note:
See TracChangeset
for help on using the changeset viewer.