forked from enlightenment/efl
tests: ecore: detect if the timeout test runs on Jenkins and increase allowed offset
From time to time we run into trouble with this test. It goes over the, already increased, limit on Jenkins. Most likely due to high load on the server. Neither Cedric nor me have been able to pin this down on local runs and we already had increased it from the initial 0.01 to 0.02 but just today we hit 0.38. What we do now is to detect if we run on our jenkins and increase the allowed value while having the intial lower value back for normal local runs.
This commit is contained in:
parent
4a5e9421e6
commit
d46829f0f9
|
@ -34,6 +34,22 @@ struct _timers // timer struct
|
||||||
double precision[3];
|
double precision[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int
|
||||||
|
_efl_test_jenkins_run(void)
|
||||||
|
{
|
||||||
|
char *jenkins_url = NULL;
|
||||||
|
|
||||||
|
jenkins_url = getenv("JENKINS_URL");
|
||||||
|
|
||||||
|
if (!jenkins_url)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (strcmp(jenkins_url, "https://build.enlightenment.org/") == 0)
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_timer1_cb(void *data)
|
_timer1_cb(void *data)
|
||||||
{
|
{
|
||||||
|
@ -182,8 +198,12 @@ _ecore_promise_quit(void *data, const Efl_Event *ev)
|
||||||
Eina_Bool *bob = data;
|
Eina_Bool *bob = data;
|
||||||
double *start = success->value;
|
double *start = success->value;
|
||||||
double delta = ecore_loop_time_get() - *start;
|
double delta = ecore_loop_time_get() - *start;
|
||||||
|
double offset = 0.01;
|
||||||
|
|
||||||
ck_assert_msg(delta - 0.2 <= 0.02, "Ecore promise timeout took %f (should be <= 0.02)\n", delta - 0.2);
|
if (_efl_test_jenkins_run())
|
||||||
|
offset *= 5;
|
||||||
|
|
||||||
|
ck_assert_msg(delta - 0.2 <= offset, "Ecore promise timeout took %f (should be <= %f)\n", delta - 0.2, offset);
|
||||||
|
|
||||||
*bob = EINA_TRUE;
|
*bob = EINA_TRUE;
|
||||||
ecore_main_loop_quit();
|
ecore_main_loop_quit();
|
||||||
|
|
Loading…
Reference in New Issue