[PATCH] app: enhance error check if enqueue fail in test_mbuf test_refcnt_iter

Stephen Hemminger stephen at networkplumber.org
Fri Oct 4 23:18:28 CEST 2024


On Thu, 24 Aug 2023 09:37:18 +0200
jhascoet <ju.hascoet at gmail.com> wrote:

> From: Julien Hascoet <ju.hascoet at gmail.com>
> 
> As the ring is big enough by construction, the ring
> enqueue ops cannot fail; therefore, we check and panic
> on it as soon as it is detected.
> 
> Signed-off-by: Julien Hascoet <ju.hascoet at gmail.com>
> ---

As per earlier patch in the email thread.
This is a test for something that should never happen.
Adding that test code is good and bad. Good, tests should never assume
code works. Bad, it creates more paths and complexity in the test code.

If the test was broken, and enqueue fails, it would fail in later checks
because of unfreed mbuf's.

Bottom line: lets skip this patch, it only happened to the submitter
because of other problems in their environment.


More information about the dev mailing list