summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2023-12-29 19:26:07 +0000
committerMaciej Żenczykowski <maze@google.com>2023-12-29 19:26:30 +0000
commit99abfd276063ab3a7748939aa55e107aaca903f6 (patch)
tree5d376d345073642c692af5ecc96b4599e42fe18c
parent46aca5d432620c315bc46a71f84b8254a3a04257 (diff)
downloadtests-99abfd276063ab3a7748939aa55e107aaca903f6.tar.gz
net-test: bpf_test - deflake an assert
There's a very very small chance that prog_fd + 1 is already occupied by some previously allocated file descriptor (likely a leaked one...) Bug: 304292059 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I81d99ab464cde734f4d5c2b8daa80227c2712ae1
-rwxr-xr-xnet/test/bpf_test.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/test/bpf_test.py b/net/test/bpf_test.py
index 0b65c32..4602515 100755
--- a/net/test/bpf_test.py
+++ b/net/test/bpf_test.py
@@ -628,7 +628,8 @@ class BpfCgroupTest(net_test.NetworkTest):
fd = BpfProgGetFdById(BpfProgQuery(self._cg_fd, BPF_CGROUP_INET_SOCK_CREATE, 0, 0))
assert fd is not None
- assert fd == self.prog_fd + 1
+ # equality while almost certain is not actually 100% guaranteed:
+ assert fd >= self.prog_fd + 1
os.close(fd)
fd = None