Branch: Tag:

2011-03-30

2011-03-30 14:14:20 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Testsuite: Tentative fix for the thread switch test failing intermittently.

The likely cause of failure is that the thread is started at the end
of a second, which causes the interval to be shorter than intended.

5060:    // Test that a loop relinquishes the interpreter lock every now and then.    int count, stop, fail;    Thread.thread_create (lambda() { -  int stop_time = time() + 1; +  int t_start = time(); +  // Note: We need sub-second precision. +  float stop_time = 1.0 + time(t_start);    while (!stop) {    count++; -  if (time() > stop_time) { +  if (time(t_start) > stop_time) {    fail = 1;    break;    }