Commit Graph

7 Commits

Author SHA1 Message Date
Wilmer Arambula
c960f93dfe Use ::class instead of ::className() in tests. (#20612) 2025-10-14 19:26:35 +03:00
Wilmer Arambula
d71f7309ae Add void return to method in tests. (#20602) 2025-10-14 12:37:35 +03:00
Maksim Spirkov
909396074e Fix codestyle in build and tests (#20586) 2025-10-10 23:04:09 +03:00
Bizley
161526cd41 HTTPS everywhere (#19503) 2022-08-03 12:32:18 +03:00
Alexander Makarov
ce0c7ad096 Fix #17533: Fix mutex testRetryAcquire() on Windows (#17591)
Skip Windows tests for retry delay

https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-sleep

> If dwMilliseconds is less than the resolution of the system clock, the thread may sleep for less
> than the specified length of time.
2019-10-03 13:53:35 +03:00
Pavel Ivanov
e5ecea653f Fixed random fails of RetryAcquireTraitTest (#17024)
Property `RetryAcquireTrait::$retryDelay` sets the minimum delay, but not the exact delay. In fact, the delay may be longer. Because of this, sometimes less than 20 blocking attempts occur. Checking the exact number of locks sometimes leads to the following errors:
```
$ vendor/bin/phpunit --filter=testRetryAcquire
PHPUnit 4.8.34 by Sebastian Bergmann and contributors.

F

You should really fix these slow tests (>500ms)...
 1. 1050ms to run yiiunit\framework\mutex\RetryAcquireTraitTest:testRetryAcquire

Time: 4.08 seconds, Memory: 44.00MB

There was 1 failure:

1) yiiunit\framework\mutex\RetryAcquireTraitTest::testRetryAcquire
Failed asserting that 19 is identical to 20.

/yii2/tests/framework/mutex/RetryAcquireTraitTest.php:36
/yii2/vendor/phpunit/phpunit/phpunit:52

FAILURES!
Tests: 1, Assertions: 3, Failures: 1.
```

I reworked the test so that it checks the duration of the delays, but not the exact number of blocking attempts.
2019-01-08 09:55:27 -05:00
Robert Korulczyk
91c96ff452 Fixes #16839
- Increase frequency of lock tries for `yii\mutex\FileMutex::acquireLock()` when $timeout is provided (rob006)
- Add support for `$timeout` in  `yii\mutex\PgsqlMutex::acquire()`
2018-11-01 01:19:33 +03:00