Daniel P. Berrangé
39015a6f3a
tests: rewrite socket to do something sensible and reliable
...
The current socket test is rather crazy in that it sets up a server
listening for sockets and then runs a client connect call, relying on
the fact that the kernel will accept this despite the application
not having called accept() yet. It then closes the client socket and
calls accept() on the server. On Linux accept() will always see that
the client has gone and so skip the rest of the code. On FreeBSD,
however, the accept sometimes succeeds, causing us to then go into
code that attempts to read and write to the client which will fail
aborting the test. The accept() never succeeds on FreeBSD guests
with a single CPU, but as you add more CPUs, accept() becomes more and
more likely to succeed, giving a 100% failure rate for the test when
using 8 CPUs.
This completely rewrites the test so that it is avoids this designed in
race condition. We simply spawn a background thread to act as the
client, which will read a byte from the server and write it back again.
The main thread can now properly listen and accept the client in a
synchronous manner avoiding any races.
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-09-04 13:22:06 +01:00
..
2018-05-13 13:38:31 +04:00
2018-06-08 21:53:36 +04:00
2018-05-13 13:38:31 +04:00
2018-08-24 13:23:36 +02:00
2017-11-20 13:22:48 +01:00
2018-04-18 11:39:53 +02:00
2018-08-20 07:18:21 +02:00
2017-04-11 14:06:47 +02:00
2017-11-07 14:58:04 +01:00
2018-03-13 13:54:06 +01:00
2017-01-18 06:31:54 -05:00
2018-08-13 14:19:41 -04:00
2018-02-02 14:51:32 +01:00
2018-04-17 21:15:27 -06:00
2017-07-11 10:41:24 +02:00
2017-03-21 11:25:59 -04:00
2017-03-21 11:25:59 -04:00
2017-03-21 11:25:59 -04:00
2018-05-25 09:36:42 -04:00
2017-12-07 09:21:04 +00:00
2017-12-07 09:21:04 +00:00
2017-12-05 14:52:49 +01:00
2018-08-28 11:49:01 +01:00
2018-07-10 13:37:51 +02:00
2018-08-28 11:49:01 +01:00
2018-06-05 08:33:13 +02:00
2017-11-30 16:49:05 +01:00
2017-10-27 14:43:21 +02:00
2018-03-19 21:22:43 +01:00
2017-07-15 14:50:42 +02:00
2018-08-13 15:50:01 +02:00
2018-04-17 12:45:26 -04:00
2018-08-21 15:46:06 +02:00
2018-08-29 11:03:07 -04:00
2018-04-03 15:48:38 +02:00
2018-08-28 17:57:38 +02:00
2018-05-29 10:22:08 +02:00
2018-08-06 12:23:55 +02:00
2018-08-06 12:23:55 +02:00
2018-05-25 09:32:37 -04:00
2018-06-26 14:02:43 -04:00
2018-06-26 14:02:43 -04:00
2018-06-26 14:02:43 -04:00
2018-03-14 17:43:40 +01:00
2018-08-14 15:52:33 +02:00
2017-07-13 09:37:52 +02:00
2017-10-16 10:22:34 +01:00
2017-07-26 15:33:45 +02:00
2018-08-14 15:52:35 +02:00
2017-07-11 14:24:17 +02:00
2018-08-13 15:50:01 +02:00
2018-02-02 13:00:48 +00:00
2018-06-26 11:22:07 +01:00
2018-08-13 14:19:41 -04:00
2017-04-04 16:36:15 +02:00
2018-04-20 09:09:29 +02:00
2018-04-17 21:15:27 -06:00
2018-06-04 20:59:16 -06:00
2018-04-09 11:33:30 -06:00
2018-04-20 09:11:01 +02:00
2017-02-14 10:54:29 +01:00
2018-02-19 13:15:00 -05:00
2018-05-13 13:38:31 +04:00
2018-02-22 13:52:45 +01:00
2018-06-07 19:26:26 +04:00
2018-05-13 13:38:31 +04:00
2018-08-15 10:15:29 +02:00
2018-04-19 14:24:12 -04:00
2018-06-05 18:44:05 +02:00
2018-08-13 15:50:01 +02:00
2018-08-28 11:49:01 +01:00
2017-11-03 13:24:12 +01:00
2018-03-13 13:54:06 +01:00
2017-11-03 13:24:12 +01:00
2017-04-27 14:13:19 +02:00
2017-04-11 13:23:01 +02:00
2017-04-28 14:17:10 +02:00
2018-08-15 10:15:29 +02:00
2018-08-13 14:19:41 -04:00
2018-04-26 13:39:10 +02:00
2017-11-03 13:24:12 +01:00
2018-07-27 15:44:38 +02:00
2018-08-13 15:50:01 +02:00
2017-11-03 13:24:12 +01:00
2018-07-26 10:13:00 -04:00
2018-08-24 10:53:59 +02:00
2018-05-30 15:54:58 +02:00
2017-11-03 13:24:12 +01:00
2017-11-03 13:24:12 +01:00
2017-11-03 13:24:12 +01:00
2017-11-03 13:24:12 +01:00
2018-05-25 09:36:42 -04:00
2018-05-03 18:23:30 +02:00
2017-11-03 13:24:12 +01:00
2017-04-19 10:51:51 +01:00
2018-05-03 17:00:57 +01:00
2017-11-03 13:24:12 +01:00
2018-05-30 15:54:58 +02:00
2017-09-19 16:04:53 +02:00
2017-11-03 13:24:12 +01:00
2018-08-13 15:50:01 +02:00
2018-08-28 14:26:25 +02:00
2018-09-04 12:00:14 +01:00
2018-08-24 13:23:36 +02:00
2018-08-13 15:50:01 +02:00
2018-06-19 14:01:14 +02:00
2018-04-10 15:16:23 +02:00
2018-08-13 15:50:00 +02:00
2018-08-13 15:50:01 +02:00
2017-07-26 15:35:24 +02:00
2018-08-21 15:46:06 +02:00
2018-02-02 14:52:23 -05:00
2018-08-13 15:50:01 +02:00
2018-09-04 10:19:23 +02:00
2018-07-13 14:15:59 +02:00
2018-04-17 12:45:26 -04:00
2018-08-24 15:58:34 +02:00
2018-08-29 11:03:07 -04:00
2018-08-24 13:23:36 +02:00
2017-04-04 17:30:03 +02:00
2017-04-04 17:30:03 +02:00
2017-11-03 13:24:12 +01:00
2018-08-06 11:50:53 +02:00
2018-08-06 11:50:53 +02:00
2017-11-03 13:24:12 +01:00
2018-04-09 11:34:35 -06:00
2017-11-03 13:24:12 +01:00
2017-11-03 13:24:12 +01:00
2018-08-06 12:23:55 +02:00
2018-06-26 14:02:43 -04:00
2018-06-26 14:02:43 -04:00
2018-03-12 20:04:08 +04:00
2017-05-15 12:34:19 +02:00
2018-07-26 10:13:00 -04:00
2018-04-19 17:57:52 +02:00
2017-07-26 15:35:02 +02:00
2014-03-18 12:17:12 +01:00
2018-09-04 10:40:34 +02:00
2018-04-19 11:20:34 +02:00
2018-07-13 14:15:59 +02:00
2018-07-10 13:37:50 +02:00
2018-04-09 11:37:15 -06:00
2018-04-09 11:37:15 -06:00
2017-11-03 13:24:12 +01:00
2017-11-03 13:24:12 +01:00
2017-04-04 17:30:03 +02:00
2017-04-04 17:30:03 +02:00
2017-11-03 13:24:12 +01:00
2018-02-05 16:08:57 +01:00
2017-11-03 13:24:12 +01:00
2018-08-06 13:44:59 +02:00
2018-08-24 13:23:36 +02:00
2018-05-03 18:23:30 +02:00
2018-07-30 13:30:11 +02:00
2017-11-09 08:04:26 -07:00
2018-06-05 14:32:36 +02:00
2017-11-03 13:24:12 +01:00
2017-08-03 09:54:36 +02:00
2018-04-24 17:01:48 +01:00
2017-04-04 17:30:03 +02:00
2017-07-26 15:33:45 +02:00
2018-06-05 14:32:36 +02:00
2017-11-03 13:24:12 +01:00
2017-11-03 13:24:12 +01:00
2017-05-09 13:12:40 +02:00
2017-11-03 13:24:12 +01:00
2018-04-11 11:18:37 +02:00
2017-04-27 14:13:19 +02:00
2018-08-14 15:52:35 +02:00
2017-11-24 11:47:26 -05:00
2017-04-04 17:30:03 +02:00
2018-07-25 07:11:13 +02:00
2018-09-04 10:19:23 +02:00
2018-03-12 16:30:49 +01:00
2017-04-04 17:30:03 +02:00
2017-11-03 13:24:12 +01:00
2017-04-04 17:30:03 +02:00
2017-11-03 13:24:12 +01:00
2018-08-13 15:50:00 +02:00
2017-11-03 13:24:12 +01:00
2018-08-13 15:50:01 +02:00
2018-08-13 15:50:01 +02:00
2017-11-03 13:24:12 +01:00
2017-11-03 13:24:12 +01:00
2017-04-04 17:30:03 +02:00
2018-06-05 14:32:36 +02:00
2018-09-04 13:22:06 +01:00
2018-03-06 10:09:44 +00:00
2017-11-03 13:24:12 +01:00
2018-07-23 11:36:09 +01:00
2018-04-24 11:02:28 +02:00
2018-06-26 11:22:07 +01:00
2018-05-03 18:23:30 +02:00
2017-11-03 13:24:12 +01:00
2017-04-04 17:30:03 +02:00
2018-02-22 13:52:45 +01:00
2018-08-02 14:24:40 +01:00
2018-01-25 17:16:08 +01:00
2017-04-04 17:30:03 +02:00
2018-06-26 11:22:07 +01:00
2017-11-03 13:24:12 +01:00
2017-04-11 14:06:47 +02:00
2017-04-13 10:14:42 +02:00
2018-08-24 10:53:20 +02:00
2018-08-13 15:50:01 +02:00
2017-11-03 13:24:12 +01:00
2018-07-27 15:47:45 +02:00
2017-11-03 13:24:12 +01:00
2018-03-23 07:14:58 +01:00
2018-08-15 10:16:16 +02:00
2017-11-03 13:24:12 +01:00
2017-04-04 17:30:03 +02:00
2017-11-03 13:24:12 +01:00
2017-10-05 09:09:50 +02:00
2018-07-27 17:21:14 +02:00
2017-11-03 13:24:12 +01:00
2018-05-25 09:33:39 -04:00
2018-09-04 11:26:03 +01:00
2018-05-08 13:45:51 +01:00
2018-06-04 20:59:16 -06:00
2018-04-09 11:33:30 -06:00
2018-04-20 09:11:01 +02:00