From 41fdf7d6ade3987e44213e591a1c67fee81e12a2 Mon Sep 17 00:00:00 2001
From: Craig Tiller <ctiller@google.com>
Date: Thu, 13 Apr 2017 18:55:46 +0000
Subject: [PATCH] Better cost estimation

---
 test/cpp/qps/gen_build_yaml.py       |  1 +
 tools/run_tests/generated/tests.json | 24 ++++++++++++------------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/test/cpp/qps/gen_build_yaml.py b/test/cpp/qps/gen_build_yaml.py
index 2f035abedd..805b0faeec 100755
--- a/test/cpp/qps/gen_build_yaml.py
+++ b/test/cpp/qps/gen_build_yaml.py
@@ -66,6 +66,7 @@ def _scenario_json_string(scenario_json, is_tsan):
 def threads_required(scenario_json, where, is_tsan):
   scenario_json = mutate_scenario(scenario_json, is_tsan)
   if scenario_json['%s_config' % where]['%s_type' % where] == 'ASYNC_%s' % where.upper():
+    if scenario_json['client_config']['client_channels'] == 1: return 1
     return scenario_json['%s_config' % where].get('async_%s_threads' % where, 0)
   return scenario_json['client_config']['outstanding_rpcs_per_channel'] * scenario_json['client_config']['client_channels']
 
diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json
index 9b48d85970..a5bc8fa0ea 100644
--- a/tools/run_tests/generated/tests.json
+++ b/tools/run_tests/generated/tests.json
@@ -41374,7 +41374,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 100, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "tsan", 
@@ -41476,7 +41476,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 2, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "tsan", 
@@ -41528,7 +41528,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 2, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "tsan", 
@@ -41953,7 +41953,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 100, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "tsan", 
@@ -42055,7 +42055,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 2, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "tsan", 
@@ -42107,7 +42107,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 2, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "tsan", 
@@ -42580,7 +42580,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 100, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "asan-noleaks", 
@@ -42730,7 +42730,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 2, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "asan-noleaks", 
@@ -42806,7 +42806,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 2, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "asan-noleaks", 
@@ -43435,7 +43435,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 100, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "asan-noleaks", 
@@ -43585,7 +43585,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 2, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "asan-noleaks", 
@@ -43661,7 +43661,7 @@
     "ci_platforms": [
       "linux"
     ], 
-    "cpu_cost": "capacity", 
+    "cpu_cost": 2, 
     "defaults": "boringssl", 
     "exclude_configs": [
       "asan-noleaks", 
-- 
GitLab