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
c2e591de
Commit
c2e591de
authored
Jun 05, 2020
by
antirez
Browse files
TCC: test threaded commands implemented so far.
parent
c47ee903
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/unit/corethreads.tcl
View file @
c2e591de
...
@@ -44,15 +44,17 @@ start_server {tags {"corethreads"}} {
...
@@ -44,15 +44,17 @@ start_server {tags {"corethreads"}} {
$rd2 close
$rd2 close
}
0
}
0
test
{
Build
two
large
set
s for the next tests
}
{
test
{
Build large
data structure
s for the next tests
}
{
for
{
set j 0
}
{
$j
< 10000
}
{
incr j
}
{
for
{
set j 0
}
{
$j
< 10000
}
{
incr j
}
{
lappend set1 $j
lappend set1 $j
lappend set2
[
expr
{
$j
*2
}]
lappend set2
[
expr
{
$j
*2
}]
}
}
r sadd set1
{*}
$set1
r sadd set1
{*}
$set1
r sadd set2
{*}
$set2
r sadd set2
{*}
$set2
r rpush list1
{*}
$set1
assert
{[
r scard set1
]
== $j
}
assert
{[
r scard set1
]
== $j
}
assert
{[
r scard set2
]
== $j
}
assert
{[
r scard set2
]
== $j
}
assert
{[
r llen list1
]
== $j
}
}
}
test
{
Lua can execute threaded commands synchronously
}
{
test
{
Lua can execute threaded commands synchronously
}
{
...
@@ -90,4 +92,29 @@ start_server {tags {"corethreads"}} {
...
@@ -90,4 +92,29 @@ start_server {tags {"corethreads"}} {
$rd read
$rd read
$rd close
$rd close
}
}
test
{
Threaded SUNION works
}
{
set res
[
r SUNION set1 set2
]
llength $res
}
{
15000
}
test
{
Threaded SDIFF works
}
{
set res
[
r SDIFF set1 set2
]
llength $res
}
{
5000
}
test
{
Threaded SINTER works
}
{
set res
[
r SINTER set1 set2
]
llength $res
}
{
5000
}
test
{
Threaded SMEMBERS works
}
{
set res
[
r SMEMBERS set1
]
llength $res
}
{
10000
}
test
{
Threaded LRANGE works
}
{
set res
[
r LRANGE list1 0 -1
]
llength $res
}
{
10000
}
}
}
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