Skip to content

Commit f97ef89

Browse files
committed
More review changes
1 parent dc32d06 commit f97ef89

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

.evergreen/run_perf_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def handle_perf(start_time: datetime):
2626
"end": int(end_time.timestamp()),
2727
"elapsed": elapsed_secs,
2828
}
29-
report = {"failures": 0, "results": [results]}
29+
report = {"results": [results]}
3030

3131
LOGGER.info("report.json\n%s", json.dumps(report, indent=2))
3232

tests/performance/perftest/tests.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
# Copyright 2025-present MongoDB, Inc.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
151
"""Tests for the MongoDB ODM Performance Benchmark Spec.
162
173
See https://github.com/mongodb/specifications/blob/master/source/benchmarking/odm-benchmarking.md
@@ -200,9 +186,10 @@ def after(self):
200186
class TestSmallFlatDocUpdate(SmallFlatDocTest, TestCase):
201187
def setUp(self):
202188
super().setUp()
189+
self.models = []
203190
for doc in self.documents:
204-
SmallFlatModel.objects.create(**doc)
205-
self.models = list(SmallFlatModel.objects.all())
191+
self.models.append(SmallFlatModel(**doc))
192+
SmallFlatModel.objects.bulk_create(self.models)
206193
self.data_size = len(encode({"field1": "updated_value0"})) * NUM_DOCS
207194
self.iteration = 0
208195

@@ -220,9 +207,11 @@ class TestSmallFlatDocFilterById(SmallFlatDocTest, TestCase):
220207
def setUp(self):
221208
super().setUp()
222209
self.ids = []
210+
models = []
223211
for doc in self.documents:
224-
model = SmallFlatModel.objects.create(**doc)
225-
self.ids.append(model.id)
212+
models.append(SmallFlatModel(**doc))
213+
inserted = SmallFlatModel.objects.bulk_create(models)
214+
self.ids = [model.id for model in inserted]
226215

227216
def do_task(self):
228217
for _id in self.ids:

0 commit comments

Comments
 (0)