Bug 1583364 - [manifestparser] Fix regression to ChunkByManifest filter, r=gbrown

Differential Revision: https://phabricator.services.mozilla.com/D54369

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Halberstadt 2019-11-27 14:07:54 +00:00
Родитель 7dca7daa86
Коммит 434b6657f5
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -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):