From 434b6657f51d20834bf89800dbe0deabe1cfa705 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Wed, 27 Nov 2019 14:07:54 +0000 Subject: [PATCH] Bug 1583364 - [manifestparser] Fix regression to ChunkByManifest filter, r=gbrown Differential Revision: https://phabricator.services.mozilla.com/D54369 --HG-- extra : moz-landing-system : lando --- testing/mozbase/manifestparser/manifestparser/filters.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/testing/mozbase/manifestparser/manifestparser/filters.py b/testing/mozbase/manifestparser/manifestparser/filters.py index 8552309fc118..9809994d3358 100644 --- a/testing/mozbase/manifestparser/manifestparser/filters.py +++ b/testing/mozbase/manifestparser/manifestparser/filters.py @@ -294,15 +294,14 @@ class chunk_by_manifest(InstanceFilter): tests_by_manifest.append(mtests) tests_by_manifest.sort(reverse=True, key=lambda x: len(x)) - tests_by_chunk = [[0, []] for i in range(self.total_chunks)] - for key, batch in tests_by_manifest: + tests_by_chunk = [[] for i in range(self.total_chunks)] + for batch in tests_by_manifest: # Sort to guarantee the chunk with the lowest score will always # get the next batch of tests. tests_by_chunk.sort(key=lambda x: len(x)) - tests_by_chunk[0][0] += key - tests_by_chunk[0][1].extend(batch) + tests_by_chunk[0].extend(batch) - return (t for t in tests_by_chunk[self.this_chunk - 1][1]) + return (t for t in tests_by_chunk[self.this_chunk - 1]) class chunk_by_runtime(InstanceFilter):