[dpdk-dev] [PATCH v2] test: add delay time in test alarm

Chen, Jing D jing.d.chen at intel.com
Fri May 5 08:28:56 CEST 2017


Hi, 
 
> diff --git a/test/test/test_alarm.c b/test/test/test_alarm.c index
> ecb2f6d..cbae1a0 100644
> --- a/test/test/test_alarm.c
> +++ b/test/test/test_alarm.c
> @@ -96,6 +96,7 @@ static int
>  test_multi_alarms(void)
>  {
>  	int rm_count = 0;
> +	int count = 0;
>  	cb_count.cnt = 0;
> 
>  	printf("Expect 6 callbacks in order...\n"); @@ -169,7 +170,10 @@
> test_multi_alarms(void)
>  		printf("Error, cancelling head-of-list leads to premature
> callback\n");
>  		return -1;
>  	}
> -	rte_delay_ms(10);
> +
> +	while (flag != 2 && count++ < 6)
> +		rte_delay_ms(10);
> +
>  	if (flag != 2) {
>  		printf("Error - expected callback not called\n");
>  		rte_eal_alarm_cancel(test_remove_in_callback, (void *)-1);
> @@ -212,7 +216,7 @@ test_alarm(void)
>  		printf("fail to set alarm callback\n");
>  		return -1;
>  	}
> -	while (flag == 0 && count ++ < 6)
> +	while (flag == 0 && count++ < 20)
>  		rte_delay_ms(RTE_TEST_CHECK_PERIOD);
> 

What's the criteria to delay 20* RTE_TEST_CHECK_PERIOD ms? Add more comments?

>  	if (flag == 0){
> --
> 2.7.4

Overall comment is to replace numeric with macro.



More information about the dev mailing list