diff options
author | Craig Tiller <ctiller@google.com> | 2016-06-17 17:37:40 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-06-17 17:37:40 -0700 |
commit | e2715df1abd3895963f849a8645d235d5ba7bf0f (patch) | |
tree | 6a2d14783d5b76a704a386a6f924662b0f049aa4 | |
parent | fa1433a4b6b0d6bbe817b4ab5f51f6167ecd837a (diff) |
Reduce cost of some heavyweight tests
-rw-r--r-- | test/core/end2end/tests/hpack_size.c | 317 | ||||
-rw-r--r-- | test/core/fling/client.c | 10 | ||||
-rw-r--r-- | test/core/support/tls_test.c | 2 | ||||
-rw-r--r-- | test/core/transport/chttp2/hpack_table_test.c | 2 |
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 73e59f1536..90ee662c3d 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); |