Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
27737964
"vscode:/vscode.git/clone" did not exist on "f86602339968cc89e31bd51fb9d6c771c3ab26ee"
Commit
27737964
authored
May 11, 2012
by
antirez
Browse files
If the computer running the Redis test is slow, we revert to --clients 1 to avoid false positives.
parent
ea66be60
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/test_helper.tcl
View file @
27737964
...
@@ -404,6 +404,18 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
...
@@ -404,6 +404,18 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
}
}
}
}
# With the parallel test running multiple Redis instances at the same time
# we need a fast enough computer, otherwise a lot of tests may generate
# false positives.
# If the computer is too slow we revert the sequetial test without any
# parallelism, that is, clients == 1.
proc is_a_slow_computer
{}
{
set start
[
clock milliseconds
]
for
{
set j 0
}
{
$j
< 1000000
}
{
incr j
}
{}
set elapsed
[
expr
[
clock milliseconds
]
-$start
]
expr
{
$elapsed
> 200
}
}
if
{
$::client
}
{
if
{
$::client
}
{
if
{[
catch
{
test_client_main $::test_server_port
}
err
]}
{
if
{[
catch
{
test_client_main $::test_server_port
}
err
]}
{
set estr
"Executing test client:
$err.
\n
$::error
Info"
set estr
"Executing test client:
$err.
\n
$::error
Info"
...
@@ -413,6 +425,11 @@ if {$::client} {
...
@@ -413,6 +425,11 @@ if {$::client} {
exit 1
exit 1
}
}
}
else
{
}
else
{
if
{[
is_a_slow_computer
]}
{
puts
"** SLOW COMPUTER ** Using a single client to avoid false positives."
set ::numclients 1
}
if
{[
catch
{
test_server_main
}
err
]}
{
if
{[
catch
{
test_server_main
}
err
]}
{
if
{[
string length $err
]
> 0
}
{
if
{[
string length $err
]
> 0
}
{
# only display error when not generated by the test suite
# only display error when not generated by the test suite
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment