Add timeout settings for Shelly cloud HTTP requests and update related tests
This commit is contained in:
@@ -14,6 +14,17 @@ it('enforces a global 2 second Shelly gate in sendPostRequest', function (): voi
|
||||
expect($sendPostRequestBody)->toContain('$this->waitForShellyRateLimitWindow();');
|
||||
});
|
||||
|
||||
it('bounds Shelly cloud HTTP requests with curl timeouts', function (): void {
|
||||
$shellyClass = file_get_contents(app_path('classes/shelly.php'));
|
||||
|
||||
expect($shellyClass)->not->toBeFalse();
|
||||
expect($shellyClass)->toContain('private const SHELLY_CONNECT_TIMEOUT_SECONDS = 2;');
|
||||
expect($shellyClass)->toContain('private const SHELLY_REQUEST_TIMEOUT_SECONDS = 5;');
|
||||
expect($shellyClass)->toContain('CURLOPT_CONNECTTIMEOUT, self::SHELLY_CONNECT_TIMEOUT_SECONDS');
|
||||
expect($shellyClass)->toContain('CURLOPT_TIMEOUT, self::SHELLY_REQUEST_TIMEOUT_SECONDS');
|
||||
expect($shellyClass)->toContain('CURLOPT_NOSIGNAL, true');
|
||||
});
|
||||
|
||||
it('uses Redis NX PX semantics for cross-request Shelly rate limiting', function (): void {
|
||||
$shellyClass = file_get_contents(app_path('classes/shelly.php'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user