Fixed the login timeout test (#1141)
This commit is contained in:
parent
06d7a496ae
commit
c31ee0e48f
|
@ -1,14 +1,18 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
False connection with LoginTimeout option
|
False connection with LoginTimeout option
|
||||||
--DESCRIPTION--
|
--DESCRIPTION--
|
||||||
Intentionally provide an invalid server name and set LoginTimeout. Verify the time elapsed.
|
Intentionally provide an invalid server and set LoginTimeout. Verify the time elapsed.
|
||||||
|
The difference in time elapsed is platform dependent. In some Linux distros, extra delay
|
||||||
|
may be caused by the attempts to resolve non-existent hostnames. Already set leeway to 2
|
||||||
|
seconds to allow some room of such errors, but this test remains fragile, especially
|
||||||
|
outside Windows. Thus, use an invalid IP address instead when running in any non-Windows platform.
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require('skipif.inc'); ?>
|
<?php require('skipif.inc'); ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('MsSetup.inc');
|
require_once('MsCommon.inc');
|
||||||
$serverName = "WRONG_SERVER_NAME";
|
$serverName = isWindows()? 'WRONG_SERVER_NAME' : '1.2.3.4';
|
||||||
|
|
||||||
// Based on the following reference, a login timeout of less than approximately 10 seconds
|
// Based on the following reference, a login timeout of less than approximately 10 seconds
|
||||||
// is not reliable. The defaut is 15 seconds so we fix it at 20 seconds.
|
// is not reliable. The defaut is 15 seconds so we fix it at 20 seconds.
|
||||||
|
@ -17,8 +21,6 @@ $timeout = 20;
|
||||||
$maxAttempts = 3;
|
$maxAttempts = 3;
|
||||||
$numAttempts = 0;
|
$numAttempts = 0;
|
||||||
|
|
||||||
// The difference in time elapsed is platform dependent, and in some distros, such as Alpine or Suse, extra delay may be caused by the attempts to resolve non-existent hostnames
|
|
||||||
// Set leeway to 2 seconds to allow some room of such errors
|
|
||||||
$leeway = 2.0;
|
$leeway = 2.0;
|
||||||
$missed = false;
|
$missed = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue