aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-06-17 20:36:17 -0700
committerGravatar GitHub <noreply@github.com>2016-06-17 20:36:17 -0700
commitc7d7be9ff2a9f89e9e2db75453195826a62611e7 (patch)
tree1b89f0008bc225012fff50e7cbe80de6a6fa00d4 /test/core
parentb6163dfb4af3bf11df6cf3f051015ec3ee4a0f68 (diff)
parente2715df1abd3895963f849a8645d235d5ba7bf0f (diff)
Merge pull request #6958 from ctiller/cpuburn
Reduce cost of some heavyweight tests
Diffstat (limited to 'test/core')
-rw-r--r--test/core/end2end/tests/hpack_size.c317
-rw-r--r--test/core/fling/client.c10
-rw-r--r--test/core/support/tls_test.c2
-rw-r--r--test/core/transport/chttp2/hpack_table_test.c2
4 files changed, 146 insertions, 185 deletions
diff --git a/test/core/end2end/tests/hpack_size.c b/test/core/end2end/tests/hpack_size.c
index ee889b77a1..7ff0461f5f 100644
--- a/test/core/end2end/tests/hpack_size.c
+++ b/test/core/end2end/tests/hpack_size.c
@@ -49,187 +49,142 @@
static void *tag(intptr_t t) { return (void *)t; }
-const char *hobbits[][2] = {{"Adaldrida", "Brandybuck"},
- {"Adamanta", "Took"},
- {"Adalgrim", "Took"},
- {"Adelard", "Took"},
- {"Amaranth", "Brandybuck"},
- {"Andwise", "Roper"},
- {"Angelica", "Baggins"},
- {"Asphodel", "Burrows"},
- {"Balbo", "Baggins"},
- {"Bandobras", "Took"},
- {"Belba", "Bolger"},
- {"Bell", "Gamgee"},
- {"Belladonna", "Baggins"},
- {"Berylla", "Baggins"},
- {"Bilbo", "Baggins"},
- {"Bilbo", "Gardner"},
- {"Bill", "Butcher"},
- {"Bingo", "Baggins"},
- {"Bodo", "Proudfoot"},
- {"Bowman", "Cotton"},
- {"Bungo", "Baggins"},
- {"Camellia", "Sackville"},
- {"Carl", "Cotton"},
- {"Celandine", "Brandybuck"},
- {"Chica", "Baggins"},
- {"Daddy", "Twofoot"},
- {"Daisy", "Boffin"},
- {"Diamond", "Took"},
- {"Dinodas", "Brandybuck"},
- {"Doderic", "Brandybuck"},
- {"Dodinas", "Brandybuck"},
- {"Donnamira", "Boffin"},
- {"Dora", "Baggins"},
- {"Drogo", "Baggins"},
- {"Dudo", "Baggins"},
- {"Eglantine", "Took"},
- {"Elanor", "Fairbairn"},
- {"Elfstan", "Fairbairn"},
- {"Esmeralda", "Brandybuck"},
- {"Estella", "Brandybuck"},
- {"Everard", "Took"},
- {"Falco", "Chubb-Baggins"},
- {"Faramir", "Took"},
- {"Farmer", "Maggot"},
- {"Fastolph", "Bolger"},
- {"Ferdibrand", "Took"},
- {"Ferdinand", "Took"},
- {"Ferumbras", "Took"},
- {"Ferumbras", "Took"},
- {"Filibert", "Bolger"},
- {"Firiel", "Fairbairn"},
- {"Flambard", "Took"},
- {"Folco", "Boffin"},
- {"Fortinbras", "Took"},
- {"Fortinbras", "Took"},
- {"Fosco", "Baggins"},
- {"Fredegar", "Bolger"},
- {"Frodo", "Baggins"},
- {"Frodo", "Gardner"},
- {"Gerontius", "Took"},
- {"Gilly", "Baggins"},
- {"Goldilocks", "Took"},
- {"Gorbadoc", "Brandybuck"},
- {"Gorbulas", "Brandybuck"},
- {"Gorhendad", "Brandybuck"},
- {"Gormadoc", "Brandybuck"},
- {"Griffo", "Boffin"},
- {"Halfast", "Gamgee"},
- {"Halfred", "Gamgee"},
- {"Halfred", "Greenhand"},
- {"Hanna", "Brandybuck"},
- {"Hamfast", "Gamgee"},
- {"Hamfast", "Gardner"},
- {"Hamson", "Gamgee"},
- {"Harding", "Gardner"},
- {"Hilda", "Brandybuck"},
- {"Hildibrand", "Took"},
- {"Hildifons", "Took"},
- {"Hildigard", "Took"},
- {"Hildigrim", "Took"},
- {"Hob", "Gammidge"},
- {"Hob", "Hayward"},
- {"Hobson", "Gamgee"},
- {"Holfast", "Gardner"},
- {"Holman", "Cotton"},
- {"Holman", "Greenhand"},
- {"Hugo", "Boffin"},
- {"Hugo", "Bracegirdle"},
- {"Ilberic", "Brandybuck"},
- {"Isembard", "Took"},
- {"Isembold", "Took"},
- {"Isengar", "Took"},
- {"Isengrim", "Took"},
- {"Isengrim", "Took"},
- {"Isumbras", "Took"},
- {"Isumbras", "Took"},
- {"Jolly", "Cotton"},
- {"Lalia", "Took"},
- {"Largo", "Baggins"},
- {"Laura", "Baggins"},
- {"Lily", "Goodbody"},
- {"Lily", "Cotton"},
- {"Linda", "Proudfoot"},
- {"Lobelia", "Sackville-Baggins"},
- {"Longo", "Baggins"},
- {"Lotho", "Sackville-Baggins"},
- {"Madoc", "Brandybuck"},
- {"Malva", "Brandybuck"},
- {"Marigold", "Cotton"},
- {"Marmadas", "Brandybuck"},
- {"Marmadoc", "Brandybuck"},
- {"Marroc", "Brandybuck"},
- {"May", "Gamgee"},
- {"Melilot", "Brandybuck"},
- {"Menegilda", "Brandybuck"},
- {"Mentha", "Brandybuck"},
- {"Meriadoc", "Brandybuck"},
- {"Merimac", "Brandybuck"},
- {"Merimas", "Brandybuck"},
- {"Merry", "Gardner"},
- {"Milo", "Burrows"},
- {"Mimosa", "Baggins"},
- {"Minto", "Burrows"},
- {"Mirabella", "Brandybuck"},
- {"Moro", "Burrows"},
- {"Mosco", "Burrows"},
- {"Mungo", "Baggins"},
- {"Myrtle", "Burrows"},
- {"Odo", "Proudfoot"},
- {"Odovacar", "Bolger"},
- {"Olo", "Proudfoot"},
- {"Orgulas", "Brandybuck"},
- {"Otho", "Sackville-Baggins"},
- {"Paladin", "Took"},
- {"Pansy", "Bolger"},
- {"Pearl", "Took"},
- {"Peony", "Burrows"},
- {"Peregrin", "Took"},
- {"Pervinca", "Took"},
- {"Pimpernel", "Took"},
- {"Pippin", "Gardner"},
- {"Polo", "Baggins"},
- {"Ponto", "Baggins"},
- {"Porto", "Baggins"},
- {"Posco", "Baggins"},
- {"Poppy", "Bolger"},
- {"Primrose", "Gardner"},
- {"Primula", "Baggins"},
- {"Prisca", "Bolger"},
- {"Reginard", "Took"},
- {"Robin", "Smallburrow"},
- {"Robin", "Gardner"},
- {"Rorimac", "Brandybuck"},
- {"Rosa", "Took"},
- {"Rosamunda", "Bolger"},
- {"Rose", "Gardner"},
- {"Ruby", "Baggins"},
- {"Ruby", "Gardner"},
- {"Rudigar", "Bolger"},
- {"Rufus", "Burrows"},
- {"Sadoc", "Brandybuck"},
- {"Salvia", "Bolger"},
- {"Samwise", "Gamgee"},
- {"Sancho", "Proudfoot"},
- {"Saradas", "Brandybuck"},
- {"Saradoc", "Brandybuck"},
- {"Seredic", "Brandybuck"},
- {"Sigismond", "Took"},
- {"Smeagol", "Gollum"},
- {"Tanta", "Baggins"},
- {"Ted", "Sandyman"},
- {"Tobold", "Hornblower"},
- {"Togo", "Goodbody"},
- {"Tolman", "Cotton"},
- {"Tolman", "Gardner"},
- {"Widow", "Rumble"},
- {"Wilcome", "Cotton"},
- {"Wilcome", "Cotton"},
- {"Wilibald", "Bolger"},
- {"Will", "Whitfoot"},
- {"Wiseman", "Gamwich"}};
+const char *hobbits[][2] = {
+ {"Adaldrida", "Brandybuck"}, {"Adamanta", "Took"},
+ {"Adalgrim", "Took"}, {"Adelard", "Took"},
+ {"Amaranth", "Brandybuck"}, {"Andwise", "Roper"},
+ {"Angelica", "Baggins"}, {"Asphodel", "Burrows"},
+ {"Balbo", "Baggins"}, {"Bandobras", "Took"},
+ {"Belba", "Bolger"}, {"Bell", "Gamgee"},
+ {"Belladonna", "Baggins"}, {"Berylla", "Baggins"},
+ {"Bilbo", "Baggins"}, {"Bilbo", "Gardner"},
+ {"Bill", "Butcher"}, {"Bingo", "Baggins"},
+ {"Bodo", "Proudfoot"}, {"Bowman", "Cotton"},
+ {"Bungo", "Baggins"}, {"Camellia", "Sackville"},
+ {"Carl", "Cotton"}, {"Celandine", "Brandybuck"},
+ {"Chica", "Baggins"}, {"Daddy", "Twofoot"},
+ {"Daisy", "Boffin"}, {"Diamond", "Took"},
+ {"Dinodas", "Brandybuck"}, {"Doderic", "Brandybuck"},
+ {"Dodinas", "Brandybuck"}, {"Donnamira", "Boffin"},
+ {"Dora", "Baggins"}, {"Drogo", "Baggins"},
+ {"Dudo", "Baggins"}, {"Eglantine", "Took"},
+ {"Elanor", "Fairbairn"}, {"Elfstan", "Fairbairn"},
+ {"Esmeralda", "Brandybuck"}, {"Estella", "Brandybuck"},
+ {"Everard", "Took"}, {"Falco", "Chubb-Baggins"},
+ {"Faramir", "Took"}, {"Farmer", "Maggot"},
+ {"Fastolph", "Bolger"}, {"Ferdibrand", "Took"},
+ {"Ferdinand", "Took"}, {"Ferumbras", "Took"},
+ {"Ferumbras", "Took"}, {"Filibert", "Bolger"},
+ {"Firiel", "Fairbairn"}, {"Flambard", "Took"},
+ {"Folco", "Boffin"}, {"Fortinbras", "Took"},
+ {"Fortinbras", "Took"}, {"Fosco", "Baggins"},
+ {"Fredegar", "Bolger"}, {"Frodo", "Baggins"},
+ {"Frodo", "Gardner"}, {"Gerontius", "Took"},
+ {"Gilly", "Baggins"}, {"Goldilocks", "Took"},
+ {"Gorbadoc", "Brandybuck"}, {"Gorbulas", "Brandybuck"},
+ {"Gorhendad", "Brandybuck"}, {"Gormadoc", "Brandybuck"},
+ {"Griffo", "Boffin"}, {"Halfast", "Gamgee"},
+ {"Halfred", "Gamgee"}, {"Halfred", "Greenhand"},
+ {"Hanna", "Brandybuck"}, {"Hamfast", "Gamgee"},
+ {"Hamfast", "Gardner"}, {"Hamson", "Gamgee"},
+ {"Harding", "Gardner"}, {"Hilda", "Brandybuck"},
+ {"Hildibrand", "Took"}, {"Hildifons", "Took"},
+ {"Hildigard", "Took"}, {"Hildigrim", "Took"},
+ {"Hob", "Gammidge"}, {"Hob", "Hayward"},
+ {"Hobson", "Gamgee"}, {"Holfast", "Gardner"},
+ {"Holman", "Cotton"}, {"Holman", "Greenhand"},
+ {"Hugo", "Boffin"}, {"Hugo", "Bracegirdle"},
+ {"Ilberic", "Brandybuck"}, {"Isembard", "Took"},
+ {"Isembold", "Took"}, {"Isengar", "Took"},
+ {"Isengrim", "Took"}, {"Isengrim", "Took"},
+ {"Isumbras", "Took"}, {"Isumbras", "Took"},
+ {"Jolly", "Cotton"},
+ /*
+ {"Lalia", "Took"},
+ {"Largo", "Baggins"},
+ {"Laura", "Baggins"},
+ {"Lily", "Goodbody"},
+ {"Lily", "Cotton"},
+ {"Linda", "Proudfoot"},
+ {"Lobelia", "Sackville-Baggins"},
+ {"Longo", "Baggins"},
+ {"Lotho", "Sackville-Baggins"},
+ {"Madoc", "Brandybuck"},
+ {"Malva", "Brandybuck"},
+ {"Marigold", "Cotton"},
+ {"Marmadas", "Brandybuck"},
+ {"Marmadoc", "Brandybuck"},
+ {"Marroc", "Brandybuck"},
+ {"May", "Gamgee"},
+ {"Melilot", "Brandybuck"},
+ {"Menegilda", "Brandybuck"},
+ {"Mentha", "Brandybuck"},
+ {"Meriadoc", "Brandybuck"},
+ {"Merimac", "Brandybuck"},
+ {"Merimas", "Brandybuck"},
+ {"Merry", "Gardner"},
+ {"Milo", "Burrows"},
+ {"Mimosa", "Baggins"},
+ {"Minto", "Burrows"},
+ {"Mirabella", "Brandybuck"},
+ {"Moro", "Burrows"},
+ {"Mosco", "Burrows"},
+ {"Mungo", "Baggins"},
+ {"Myrtle", "Burrows"},
+ {"Odo", "Proudfoot"},
+ {"Odovacar", "Bolger"},
+ {"Olo", "Proudfoot"},
+ {"Orgulas", "Brandybuck"},
+ {"Otho", "Sackville-Baggins"},
+ {"Paladin", "Took"},
+ {"Pansy", "Bolger"},
+ {"Pearl", "Took"},
+ {"Peony", "Burrows"},
+ {"Peregrin", "Took"},
+ {"Pervinca", "Took"},
+ {"Pimpernel", "Took"},
+ {"Pippin", "Gardner"},
+ {"Polo", "Baggins"},
+ {"Ponto", "Baggins"},
+ {"Porto", "Baggins"},
+ {"Posco", "Baggins"},
+ {"Poppy", "Bolger"},
+ {"Primrose", "Gardner"},
+ {"Primula", "Baggins"},
+ {"Prisca", "Bolger"},
+ {"Reginard", "Took"},
+ {"Robin", "Smallburrow"},
+ {"Robin", "Gardner"},
+ {"Rorimac", "Brandybuck"},
+ {"Rosa", "Took"},
+ {"Rosamunda", "Bolger"},
+ {"Rose", "Gardner"},
+ {"Ruby", "Baggins"},
+ {"Ruby", "Gardner"},
+ {"Rudigar", "Bolger"},
+ {"Rufus", "Burrows"},
+ {"Sadoc", "Brandybuck"},
+ {"Salvia", "Bolger"},
+ {"Samwise", "Gamgee"},
+ {"Sancho", "Proudfoot"},
+ {"Saradas", "Brandybuck"},
+ {"Saradoc", "Brandybuck"},
+ {"Seredic", "Brandybuck"},
+ {"Sigismond", "Took"},
+ {"Smeagol", "Gollum"},
+ {"Tanta", "Baggins"},
+ {"Ted", "Sandyman"},
+ {"Tobold", "Hornblower"},
+ {"Togo", "Goodbody"},
+ {"Tolman", "Cotton"},
+ {"Tolman", "Gardner"},
+ {"Widow", "Rumble"},
+ {"Wilcome", "Cotton"},
+ {"Wilcome", "Cotton"},
+ {"Wilibald", "Bolger"},
+ {"Will", "Whitfoot"},
+ {"Wiseman", "Gamwich"}*/
+};
const char *dragons[] = {"Ancalagon", "Glaurung", "Scatha",
"Smaug the Magnificent"};
diff --git a/test/core/fling/client.c b/test/core/fling/client.c
index 123f2b5bbe..bcc195a92f 100644
--- a/test/core/fling/client.c
+++ b/test/core/fling/client.c
@@ -177,12 +177,17 @@ int main(int argc, char **argv) {
fake_argv[0] = argv[0];
grpc_test_init(1, fake_argv);
+ int warmup_seconds = 1;
+ int benchmark_seconds = 5;
+
cl = gpr_cmdline_create("fling client");
gpr_cmdline_add_int(cl, "payload_size", "Size of the payload to send",
&payload_size);
gpr_cmdline_add_string(cl, "target", "Target host:port", &target);
gpr_cmdline_add_flag(cl, "secure", "Run with security?", &secure);
gpr_cmdline_add_string(cl, "scenario", "Scenario", &scenario_name);
+ gpr_cmdline_add_int(cl, "warmup", "Warmup seconds", &warmup_seconds);
+ gpr_cmdline_add_int(cl, "benchmark", "Benchmark seconds", &benchmark_seconds);
gpr_cmdline_parse(cl, argc, argv);
gpr_cmdline_destroy(cl);
@@ -206,8 +211,9 @@ int main(int argc, char **argv) {
sc.init();
- gpr_timespec end_warmup = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3);
- gpr_timespec end_profiling = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(30);
+ gpr_timespec end_warmup = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(warmup_seconds);
+ gpr_timespec end_profiling =
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(warmup_seconds + benchmark_seconds);
while (gpr_time_cmp(gpr_now(end_warmup.clock_type), end_warmup) < 0) {
sc.do_one_step();
diff --git a/test/core/support/tls_test.c b/test/core/support/tls_test.c
index 7b732ee10e..2acc302ef2 100644
--- a/test/core/support/tls_test.c
+++ b/test/core/support/tls_test.c
@@ -50,7 +50,7 @@ static void thd_body(void *arg) {
GPR_ASSERT(gpr_tls_get(&test_var) == 0);
- for (i = 0; i < 10000000; i++) {
+ for (i = 0; i < 100000; i++) {
gpr_tls_set(&test_var, i);
GPR_ASSERT(gpr_tls_get(&test_var) == i);
}
diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c
index 98e486c69c..75b0ef4629 100644
--- a/test/core/transport/chttp2/hpack_table_test.c
+++ b/test/core/transport/chttp2/hpack_table_test.c
@@ -139,7 +139,7 @@ static void test_many_additions(void) {
grpc_chttp2_hptbl_init(&tbl);
- for (i = 0; i < 1000000; i++) {
+ for (i = 0; i < 100000; i++) {
grpc_mdelem *elem;
gpr_asprintf(&key, "K:%d", i);
gpr_asprintf(&value, "VALUE:%d", i);