Skip to content

Commit 56925f3

Browse files
Yonghong SongAlexei Starovoitov
Yonghong Song
authored and
Alexei Starovoitov
committed
selftests/bpf: Remove flaky test_btf_id test
With previous patch, one of subtests in test_btf_id becomes flaky and may fail. The following is a failing example: Error: #26 btf Error: #26/174 btf/BTF ID Error: #26/174 btf/BTF ID btf_raw_create:PASS:check 0 nsec btf_raw_create:PASS:check 0 nsec test_btf_id:PASS:check 0 nsec ... test_btf_id:PASS:check 0 nsec test_btf_id:FAIL:check BTF lingersdo_test_get_info:FAIL:check failed: -1 The test tries to prove a btf_id not available after the map is closed. But btf_id is freed only after workqueue and a rcu grace period, compared to previous case just after a rcu grade period. Depending on system workload, workqueue could take quite some time to execute function bpf_map_free_deferred() which may cause the test failure. Instead of adding arbitrary delays, let us remove the logic to check btf_id availability after map is closed. Signed-off-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 59e5791 commit 56925f3

File tree

1 file changed

+0
-5
lines changed
  • tools/testing/selftests/bpf/prog_tests

1 file changed

+0
-5
lines changed

tools/testing/selftests/bpf/prog_tests/btf.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4630,11 +4630,6 @@ static int test_btf_id(unsigned int test_num)
46304630
/* The map holds the last ref to BTF and its btf_id */
46314631
close(map_fd);
46324632
map_fd = -1;
4633-
btf_fd[0] = bpf_btf_get_fd_by_id(map_info.btf_id);
4634-
if (CHECK(btf_fd[0] >= 0, "BTF lingers")) {
4635-
err = -1;
4636-
goto done;
4637-
}
46384633

46394634
fprintf(stderr, "OK");
46404635

0 commit comments

Comments
 (0)