Skip to content

Commit ba435f2

Browse files
Remove temporary fix for mange_vms (#4177)
1 parent 4489ae2 commit ba435f2

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

src/clusterfuzz/_internal/cron/manage_vms.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import itertools
2020
import json
2121
import logging
22-
from typing import List
2322

2423
from google.cloud import ndb
2524

@@ -157,21 +156,6 @@ def _template_needs_update(current_template, new_template, resource_name):
157156
return False
158157

159158

160-
def reverse_pairs(l: List) -> List:
161-
"""Temporary function to speedup resizing of group 8 which hasn't been
162-
updating due to timeouts."""
163-
l = list(reversed(l))
164-
length = len(l)
165-
l_output = []
166-
for idx in range(0, length, 2):
167-
if idx + 1 >= length:
168-
l_output.append(l[idx])
169-
continue
170-
l_output.append(l[idx + 1])
171-
l_output.append(l[idx])
172-
return l_output
173-
174-
175159
class ClustersManager:
176160
"""Manager for clusters in a project."""
177161

@@ -202,10 +186,7 @@ def update_clusters(self):
202186
"""Update all clusters in a project."""
203187
self.start_thread_pool()
204188

205-
# TODO(metzman): Remove reverse_pairs.
206-
# Use this function so we don't introduce weird bugs by changing the order
207-
# in which hosts and workers are reassigned.
208-
for cluster in reverse_pairs(self.gce_project.clusters):
189+
for cluster in self.gce_project.clusters:
209190
self.pending_updates.append(
210191
self.thread_pool.submit(self.update_cluster, cluster, cluster.name,
211192
cluster.instance_count))

src/clusterfuzz/_internal/tests/appengine/handlers/cron/manage_vms_test.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,14 +1084,6 @@ def test_primes(self):
10841084
self.assertEqual(3571, sum(result))
10851085

10861086

1087-
class ReversePairsTest(unittest.TestCase):
1088-
"""Tests reverse_pairs."""
1089-
1090-
def test_reverse_pairs(self):
1091-
l = list(range(6))
1092-
self.assertEqual(manage_vms.reverse_pairs(l), [4, 5, 2, 3, 0, 1])
1093-
1094-
10951087
@test_utils.with_cloud_emulators('datastore')
10961088
class AssignHostWorkerTest(unittest.TestCase):
10971089
"""Tests host -> worker assignment."""

0 commit comments

Comments
 (0)