Skip to content

Commit bd180fd

Browse files
committed
[run_cperf] Segregate failed-module calculation by config as well as instance.
1 parent 6952162 commit bd180fd

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

run_cperf

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,30 +392,40 @@ def all_driver_stats_files(configs, args):
392392
try:
393393
with open(os.path.join(root, f)) as fp:
394394
j = json.load(fp)
395-
yield (instance, m.group(1), j)
395+
yield (config, instance, m.group(1), j)
396396
except ValueError:
397397
# Something sufficiently bad happened that
398398
# we can't read the json: build a fake one.
399-
yield (instance, m.group(1), {})
399+
yield (config, instance, m.group(1), {})
400400

401401

402402
def find_module_statuses(configs, args):
403403
passed = set()
404404
failed = set()
405405
k = 'Driver.NumProcessFailures'
406-
instance_modules = {}
407-
instance_modules[OLD_INSTANCE] = set()
408-
instance_modules[NEW_INSTANCE] = set()
406+
module_sets = {}
407+
for config in configs:
408+
module_sets[config] = {}
409+
module_sets[config][OLD_INSTANCE] = set()
410+
module_sets[config][NEW_INSTANCE] = set()
409411

410-
for (instance, module, j) in all_driver_stats_files(configs, args):
412+
for (config, instance, module, j) in all_driver_stats_files(configs, args):
411413
# Treat a module as failed if there was >0 process failures,
412414
# or we can't tell, _or_ it's in one instance but not in the other.
413-
instance_modules[instance].add(module)
415+
module_sets[config][instance].add(module)
414416
if j.get(k, 1) == 0:
415417
passed.add(module)
416418
else:
417419
failed.add(module)
418-
mismatched_modules = instance_modules[OLD_INSTANCE].symmetric_difference(instance_modules[NEW_INSTANCE])
420+
421+
mismatched_modules = None
422+
for config in configs:
423+
for instance in [OLD_INSTANCE, NEW_INSTANCE]:
424+
mods = module_sets[config][instance]
425+
if mismatched_modules is None:
426+
mismatched_modules = mods
427+
else:
428+
mismatched_modules.symmetric_difference_update(mods)
419429
failed.update(mismatched_modules)
420430
passed.difference_update(mismatched_modules)
421431
return (passed, failed)

0 commit comments

Comments
 (0)