From 2eeb06c8b7acc8f38dca8d3bb2df6dedfd0e58ec Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Fri, 6 Sep 2024 08:42:44 -0700 Subject: [PATCH] Limit retries to 10 attempts Signed-off-by: Alan Jowett --- tests/api_test/api_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api_test/api_test.cpp b/tests/api_test/api_test.cpp index b3ec4ed3ab..ec1094bdbd 100644 --- a/tests/api_test/api_test.cpp +++ b/tests/api_test/api_test.cpp @@ -91,8 +91,8 @@ static _Success_(return == 0) int _program_load_helper( bpf_program__set_type(program, prog_type); } - int error; - for (;;) { + int error = -EBUSY; + for (size_t retries = 0; retries < 10; retries++) { error = bpf_object__load(new_object); if (error == -EBUSY) { // Wait for the previous driver to be unloaded.