fusefs: fix intermittency in the BadServer.ShortWrite test

This test implicitly depended on the order in which two threads
completed.  If the test thread finished first, the test would pass.  But
if the mock file system thread did, it would attempt to read from an
unmounted file system, and fail.  As a result, the test would randomly
fail once out of every several thousand executions.  Fix it by telling
the mock file system's event loop to exit without attempting to read any
more events.

Reported by:	Siva Mahadevan <me@svmhdvn.name>
MFC after:	1 week
Reviewed by:	Siva Mahadevan <me@svmhdvn.name>
Differential Revision: https://reviews.freebsd.org/D53080
This commit is contained in:
Alan Somers
2025-10-13 20:18:48 -06:00
parent 7117c86fcb
commit d1bd541b38
+5
View File
@@ -65,6 +65,11 @@ TEST_F(BadServer, ShortWrite)
out.header.unique = 0; // Asynchronous notification
out.expected_errno = EINVAL;
m_mock->write_response(out);
/*
* Tell the event loop to quit. The kernel has already disconnected us
* because of the short write.
*/
m_mock->m_quit = true;
}
/*