1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00
freebsd/libexec/tftpd
Mark Johnston 79c342aaf8 tftpd: Address flaky tests
The tftpd tests all follow the same pattern:
1. open a UDP socket,
2. fork a child to exec tftpd, which subsequently handles requests on
   the socket,
3. use a client socket to send some message to the tftpd daemon.

However, tftpd's first action is to mark its socket as non-blocking and
then read a request from it.  If no data is present in the socket, tftpd
exits immediately with an error.  So, there is a race; we often see
tftpd test timeouts when running tests in parallel.  These timeouts also
arise periodically in CI runs.

One solution is to restructure each test to create the server socket,
then write the request to the client socket, then fork tftpd.  This
closes the race.  However, this involves a lot of churn.

This patch fixes the problem a different way, by adding a new -b flag to
tftpd which makes it block to read the initial request.  Each test is
modified to use -b, closing the race.

Reviewed by:	imp, asomers
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D47404
2024-11-03 16:47:38 +00:00
..
tests tftpd: Address flaky tests 2024-11-03 16:47:38 +00:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend.options Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tftp-file.c libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
tftp-file.h tftpd: Drop unneeded includes. 2024-05-10 23:16:26 +02:00
tftp-io.c tftpd: Satisfy clang-analyzer. 2024-05-10 23:16:26 +02:00
tftp-io.h tftpd: Drop unneeded includes. 2024-05-10 23:16:26 +02:00
tftp-options.c libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
tftp-options.h tftpd: Drop unneeded includes. 2024-05-10 23:16:26 +02:00
tftp-transfer.c libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
tftp-transfer.h tftpd: Drop unneeded includes. 2024-05-10 23:16:26 +02:00
tftp-utils.c tftpd: Satisfy clang-analyzer. 2024-05-10 23:16:26 +02:00
tftp-utils.h tftpd: Satisfy clang-analyzer. 2024-05-10 23:16:26 +02:00
tftpd.8 tftpd: Address flaky tests 2024-11-03 16:47:38 +00:00
tftpd.c tftpd: Address flaky tests 2024-11-03 16:47:38 +00:00