diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-05-19 17:42:00 +1000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-19 08:04:34 +0000 |
commit | 49666bd0671633519d5d05ec8ee183adbf2ec60f (patch) | |
tree | 317d6fe3b3547988a7c699c3f00963d8e0995bfc /src/third_party | |
parent | 1be4138e2af11dca772bdecf72e97eb842de7e78 (diff) | |
download | mongo-49666bd0671633519d5d05ec8ee183adbf2ec60f.tar.gz |
Import wiredtiger: cd82b429eb6ab8a57ad185c75d09170e1b9af1f7 from branch mongodb-5.0
ref: 22ccc89622..cd82b429eb
for: 5.0.1
WT-6230 Sanitize python test suite directory naming
Diffstat (limited to 'src/third_party')
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rwxr-xr-x | src/third_party/wiredtiger/test/suite/wttest.py | 22 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 069b48a1560..976707090c8 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-5.0", - "commit": "22ccc89622a94818aed9b6714f134d34819f388e" + "commit": "cd82b429eb6ab8a57ad185c75d09170e1b9af1f7" } diff --git a/src/third_party/wiredtiger/test/suite/wttest.py b/src/third_party/wiredtiger/test/suite/wttest.py index 87db069fefe..2af91d5704c 100755 --- a/src/third_party/wiredtiger/test/suite/wttest.py +++ b/src/third_party/wiredtiger/test/suite/wttest.py @@ -404,8 +404,19 @@ class WiredTigerTestCase(unittest.TestCase): def setUp(self): if not hasattr(self.__class__, 'wt_ntests'): self.__class__.wt_ntests = 0 + + # We want to have a unique execution directory name for each test. + # When a test fails, or with the -p option, we want to preserve the + # directory. For the non concurrent case, this is easy, we use the + # class name (like test_base02) and append a class-specific counter. + # This is short, somewhat descriptive, and unique. + # + # Class-specific counters won't work for the concurrent case. To + # get uniqueness we use a sanitized "short" identifier. Despite its name, + # this is not short (with scenarios at least), but it is descriptive + # and unique. if WiredTigerTestCase._concurrent: - self.testsubdir = self.shortid() + '.' + str(self.__class__.wt_ntests) + self.testsubdir = self.sanitized_shortid() else: self.testsubdir = self.className() + '.' + str(self.__class__.wt_ntests) self.testdir = os.path.join(WiredTigerTestCase._parentTestdir, self.testsubdir) @@ -749,6 +760,15 @@ class WiredTigerTestCase(unittest.TestCase): def shortid(self): return self.id().replace("__main__.","") + def sanitized_shortid(self): + """ + Return a name that is suitable for creating file system names. + In particular, names with scenarios look like + 'test_file.test_file.test_funcname(scen1.scen2.scen3)'. + So transform '(', but remove final ')'. + """ + return self.shortid().translate(str.maketrans('($[]/ ','______', ')')) + def className(self): return self.__class__.__name__ |