diff mbox series

[bpf-next,3/5] selftests/bpf: test_sockmap, fix test timeout

Message ID 20180518071753.4768-4-bhole_prashant_q7@lab.ntt.co.jp
State Changes Requested, archived
Delegated to: BPF Maintainers
Headers show
Series fix test_sockmap | expand

Commit Message

Prashant Bhole May 18, 2018, 7:17 a.m. UTC
In order to reduce runtime of tests, recently timout for select() call
was reduced from 1sec to 10usec. This was causing many tests failures.
It was caught with failure handling commits in this series.

Restoring the timeout from 10usec to 1sec

Fixes: a18fda1a62c3 ("bpf: reduce runtime of test_sockmap tests")
Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
---
 tools/testing/selftests/bpf/test_sockmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

John Fastabend May 18, 2018, 4:47 p.m. UTC | #1
On 05/18/2018 12:17 AM, Prashant Bhole wrote:
> In order to reduce runtime of tests, recently timout for select() call
> was reduced from 1sec to 10usec. This was causing many tests failures.
> It was caught with failure handling commits in this series.
> 
> Restoring the timeout from 10usec to 1sec
> 
> Fixes: a18fda1a62c3 ("bpf: reduce runtime of test_sockmap tests")
> Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
> ---

Whats the runtime for the entire test suite after this? I agree
I was probably to aggressive in setting this but on the other
hand I was trying to avoid letting the test run for minutes.

.John
Prashant Bhole May 21, 2018, 5:15 a.m. UTC | #2
On 5/19/2018 1:47 AM, John Fastabend wrote:
> On 05/18/2018 12:17 AM, Prashant Bhole wrote:
>> In order to reduce runtime of tests, recently timout for select() call
>> was reduced from 1sec to 10usec. This was causing many tests failures.
>> It was caught with failure handling commits in this series.
>>
>> Restoring the timeout from 10usec to 1sec
>>
>> Fixes: a18fda1a62c3 ("bpf: reduce runtime of test_sockmap tests")
>> Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
>> ---
> 
> Whats the runtime for the entire test suite after this? I agree
> I was probably to aggressive in setting this but on the other
> hand I was trying to avoid letting the test run for minutes.
> 

Currently any failure stops further tests.
So I made local change to force cork=0. With this change, it takes 
around 60 seconds for all 648 tests. It will change after fixing cork tests.

-Prashant
John Fastabend May 21, 2018, 5:13 p.m. UTC | #3
On 05/20/2018 10:15 PM, Prashant Bhole wrote:
> 
> 
> On 5/19/2018 1:47 AM, John Fastabend wrote:
>> On 05/18/2018 12:17 AM, Prashant Bhole wrote:
>>> In order to reduce runtime of tests, recently timout for select() call
>>> was reduced from 1sec to 10usec. This was causing many tests failures.
>>> It was caught with failure handling commits in this series.
>>>
>>> Restoring the timeout from 10usec to 1sec
>>>
>>> Fixes: a18fda1a62c3 ("bpf: reduce runtime of test_sockmap tests")
>>> Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
>>> ---
>>
>> Whats the runtime for the entire test suite after this? I agree
>> I was probably to aggressive in setting this but on the other
>> hand I was trying to avoid letting the test run for minutes.
>>
> 
> Currently any failure stops further tests.
> So I made local change to force cork=0. With this change, it takes
> around 60 seconds for all 648 tests. It will change after fixing cork
> tests.
> 
> -Prashant
> 


OK, lets see how long it takes with the cork tests fixed. Maybe if
the cork flag is set we should lower the timeout to 100us.

.John
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index 8a81ea0e9fb6..f79397513362 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -345,8 +345,8 @@  static int msg_loop(int fd, int iov_count, int iov_length, int cnt,
 		if (err < 0)
 			perror("recv start time: ");
 		while (s->bytes_recvd < total_bytes) {
-			timeout.tv_sec = 0;
-			timeout.tv_usec = 10;
+			timeout.tv_sec = 1;
+			timeout.tv_usec = 0;
 
 			/* FD sets */
 			FD_ZERO(&w);