Skip to content
Snippets Groups Projects
Commit 35d090e2 authored by totten's avatar totten
Browse files

QueueTest - Be more forgiving about slow execution

The `CRM_Queue_QueueTest` is producing failures with the
[TIME_FUNC](https://github.com/civicrm/civicrm-core/pull/17414) option of
`linear:500` (the value currently used in PR test runs) -- which is to say,
it fails when the system runs very slowly (with some 500ms stalling during
execution).

This gets it working under some very slow scenarios:

```
for TIME_FUNC in natural frozen linear:500 linear:1250 prng:500 prng:666 prng:1000 prng:1500 ; do
  export TIME_FUNC;
  echo;
  echo "TIME_FUNC=$TIME_FUNC" ;
  env CIVICRM_UF=UnitTests phpunit6 tests/phpunit/CRM/Queue/QueueTest.php ;
done
```
parent 88890043
No related branches found
No related tags found
No related merge requests found
......@@ -155,7 +155,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase {
$this->assertEquals(FALSE, $item2);
// pass expiration mark
CRM_Utils_Time::setTime('2012-04-01 2:00:01');
CRM_Utils_Time::setTime('2012-04-01 2:00:03');
$item3 = $this->queue->claimItem();
$this->assertEquals('a', $item3->data['test-key']);
$this->assertEquals(1, $this->queue->numberOfItems());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment