Philip Withnall
9f27f49e34
tests: Speed up the cancellable test
...
The test added for #1841 spawned 100000 threads. That was fine on a
desktop machine, but on a heavily loaded CI machine, it could result in
large (and unpredictable) slowdowns, resulting in the test taking over
120s in about 1 in 5 runs, and hence failing that CI pipeline due to a
timeout. When passing normally on CI, the test would take around 90s.
Here’s a histogram of time per iteration on a failing (timed out) test
run. Each iteration is one thread spawn:
Iteration duration (µs) | Frequency
------------------------+----------
≤100 | 0
100–200 | 30257
200–400 | 13696
400–800 | 1046
800–1000 | 123
1000–2000 | 583
2000–4000 | 3779
4000–8000 | 4972
8000–10000 | 1027
10000–20000 | 2610
20000–40000 | 650
40000–80000 | 86
80000–100000 | 10
100000–200000 | 2
>200000 | 0
There’s no actual need for the test to spawn 100000 threads, so rewrite
it to reuse a single thread, and pass new data to that thread.
Reverting the original commit (e4a690f5dd95) reproduces the failure on
100 out of 100 test runs with this commit applied, so the test still
works.
The test now takes 3s, rather than 11s, to run on my computer, and has
passed when run with `meson test --repeat 1000 cancellable`.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-20 17:21:14 +01:00
..
2018-12-18 11:43:08 +01:00
2017-07-13 19:03:39 -04:00
2018-09-23 17:01:04 +01:00
2020-01-29 15:40:17 +01:00
2019-01-15 15:11:43 +00:00
2017-10-11 10:22:23 +01:00
2019-12-17 20:56:49 +08:00
2018-10-23 09:45:12 -04:00
2013-10-24 13:55:33 -04:00
2014-01-01 17:59:20 -05:00
2019-03-12 21:53:43 +03:00
2019-02-20 10:38:29 +00:00
2019-12-18 16:51:11 +00:00
2018-12-17 17:16:03 +00:00
2013-07-11 13:49:20 -04:00
2018-12-17 17:16:03 +00:00
2018-12-17 17:16:03 +00:00
2018-12-17 17:16:04 +00:00
2018-12-17 17:16:03 +00:00
2019-06-28 13:05:07 +01:00
2019-06-28 13:05:07 +01:00
2018-12-17 17:16:04 +00:00
2014-09-09 14:11:38 -04:00
2015-08-31 13:59:48 -04:00
2013-09-29 17:48:40 -04:00
2019-02-13 08:49:42 +00:00
2014-01-01 22:01:15 -05:00
2013-12-15 21:07:12 -05:00
2020-05-20 17:21:14 +01:00
2020-01-27 10:42:26 +00:00
2019-06-03 12:16:50 +01:00
2016-04-26 15:20:16 +02:00
2015-08-31 13:59:48 -04:00
2020-05-07 14:19:16 +01:00
2018-02-16 17:38:26 +00:00
2018-09-04 20:24:25 +02:00
2019-12-17 21:03:03 +08:00
2019-03-12 21:53:43 +03:00
2019-10-26 14:06:31 +01:00
2019-04-26 12:12:31 +01:00
2020-01-07 11:20:45 +00:00
2019-11-21 10:49:31 +00:00
2018-04-26 15:19:17 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2020-02-24 09:08:20 +00:00
2020-01-30 01:33:09 +00:00
2015-05-11 20:24:56 +01:00
2018-09-13 13:16:40 +02:00
2018-01-03 11:08:37 +00:00
2019-04-25 09:25:49 +01:00
2019-03-12 21:54:47 +03:00
2019-10-08 13:53:01 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2019-12-11 11:04:10 +01:00
2020-02-24 07:46:22 +00:00
2018-04-27 16:46:19 +01:00
2020-05-05 13:29:29 +01:00
2017-05-29 19:53:34 +02:00
2017-04-10 10:38:31 +01:00
2018-10-04 10:45:45 +02:00
2018-10-04 10:45:45 +02:00
2019-06-11 11:06:36 +01:00
2017-04-10 10:38:31 +01:00
2018-07-09 13:28:02 +02:00
2017-05-29 19:53:34 +02:00
2019-12-18 16:39:56 +00:00
2017-05-29 19:53:34 +02:00
2019-01-28 14:37:22 +00:00
2020-02-16 10:00:31 +00:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-06-29 12:13:32 +01:00
2020-05-07 14:19:16 +01:00
2017-05-29 19:53:34 +02:00
2018-11-10 03:53:32 +00:00
2017-05-29 19:53:34 +02:00
2019-03-07 13:57:38 +00:00
2019-11-18 17:53:55 +00:00
2020-05-07 14:19:16 +01:00
2019-12-17 20:56:49 +08:00
2017-05-29 19:53:34 +02:00
2020-01-27 10:11:46 +00:00
2019-12-17 20:56:49 +08:00
2020-02-24 09:01:03 +00:00
2020-02-24 07:46:22 +00:00
2019-03-07 13:57:38 +00:00
2020-02-24 12:24:02 +00:00
2018-12-05 18:27:16 +08:00
2018-05-22 14:34:17 +05:30
2015-07-23 04:22:59 -04:00
2019-07-15 11:01:04 +00:00
2019-09-25 08:37:22 +02:00
2019-03-05 15:14:58 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2018-08-19 20:04:41 +02:00
2019-01-15 15:11:43 +00:00
2019-08-21 20:08:04 +03:00
2019-02-27 09:20:28 -05:00
2018-12-19 14:54:27 +00:00
2019-05-31 23:35:27 +01:00
2020-01-30 04:19:22 -06:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-09-11 22:14:18 +01:00
2016-07-11 17:42:41 -04:00
2015-02-17 16:27:46 -05:00
2020-02-13 17:33:45 +00:00
2013-06-02 01:44:49 -04:00
2020-04-23 15:01:25 +01:00
2020-04-23 15:01:25 +01:00
2019-12-11 11:44:42 +00:00
2019-01-24 16:25:56 +02:00
2020-04-09 14:55:39 +01:00
2018-12-17 17:16:04 +00:00
2019-10-10 14:32:18 +01:00
2018-12-11 16:09:29 -05:00
2018-06-21 15:32:04 +02:00
2019-10-10 14:32:18 +01:00
2018-09-13 11:44:16 +01:00
2018-04-10 10:35:45 +01:00
2013-07-14 11:36:45 -04:00
2019-12-17 20:59:22 +08:00
2018-06-22 22:02:31 +03:00
2018-06-22 22:02:31 +03:00
2018-12-14 17:07:22 +01:00
2018-12-11 16:09:29 -05:00
2017-05-29 19:53:34 +02:00
2018-09-12 15:42:11 +00:00
2019-04-26 12:12:31 +01:00
2019-06-24 10:58:51 +08:00
2019-07-15 11:01:04 +00:00
2019-07-29 12:27:29 +01:00
2017-05-29 19:53:34 +02:00
2018-06-29 12:13:32 +01:00
2018-09-04 20:24:25 +02:00
2018-12-11 16:12:48 -05:00
2015-10-13 15:42:14 +01:00
2019-04-25 09:25:49 +01:00
2017-05-29 19:53:34 +02:00
2019-04-25 09:25:49 +01:00
2019-02-21 18:15:49 +00:00
2020-01-07 15:07:37 +00:00
2019-12-04 14:06:23 +01:00
2017-05-29 19:53:34 +02:00
2019-12-02 14:27:11 +00:00
2019-11-15 10:37:42 +00:00
2019-01-10 13:50:26 -05:00
2018-12-05 18:27:16 +08:00
2018-12-19 16:43:21 +00:00
2019-09-02 20:47:20 +01:00
2017-05-29 19:53:34 +02:00
2017-05-29 19:53:34 +02:00
2017-11-29 17:50:27 +00:00
2017-05-29 19:53:34 +02:00
2016-06-04 08:24:22 -04:00
2019-10-18 17:02:57 +01:00
2020-01-30 01:56:56 +00:00
2020-01-30 04:19:22 -06:00
2018-09-03 13:55:57 +10:00
2019-07-25 15:23:21 +01:00
2019-01-17 16:31:10 +00:00
2018-06-20 12:16:34 +01:00
2020-02-24 16:18:58 +00:00
2016-06-28 15:57:49 +02:00
2020-01-20 15:22:03 +00:00
2014-08-02 12:41:14 +00:00