From 7bee757376a4633e1ccf9bdccdf9fc214cb4a421 Mon Sep 17 00:00:00 2001 From: Will Korteland Date: Thu, 17 Mar 2022 09:57:49 +0000 Subject: Import wiredtiger: 89550147760280fcc5271308f6edb3f767aacb0e from branch mongodb-master ref: 324fdee42e..8955014776 for: 6.0.0 WT-8948 Empty test_*.py files cause test discovery to crash --- src/third_party/wiredtiger/import.data | 2 +- src/third_party/wiredtiger/test/suite/run.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 48ca57a0f18..ac123651642 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-master", - "commit": "324fdee42e1e5a99c274fc2e552c007aa786c523" + "commit": "89550147760280fcc5271308f6edb3f767aacb0e" } diff --git a/src/third_party/wiredtiger/test/suite/run.py b/src/third_party/wiredtiger/test/suite/run.py index 1e63fbd14d5..dee8b0a49fc 100755 --- a/src/third_party/wiredtiger/test/suite/run.py +++ b/src/third_party/wiredtiger/test/suite/run.py @@ -578,6 +578,20 @@ if __name__ == '__main__': sys.exit(2) from discover import defaultTestLoader as loader suites = loader.discover(suitedir) + + # If you have an empty Python file, it comes back as an empty entry in suites + # and then the sort explodes. Drop empty entries first. Note: this converts + # suites to a list, but the sort does that anyway. Also note: there seems to be + # no way to count other than iteration; there's a count method but it also + # returns zero for test files that contain a test class with no test functions, + # and it's not clear that dropping those here is correct. + def isempty(s): + count = 0 + for c in s: + count += 1 + return (count == 0) + suites = [s for s in suites if not isempty(s)] + suites = sorted(suites, key=lambda c: str(list(c)[0])) if configfile != None: suites = configApply(suites, configfile, configwrite) -- cgit v1.2.1