Skip to content

Commit 2c9db1a

Browse files
authored
Enable large-memory tests solo runs in daily workflow (#1816)
This change re-introduce large-memory tests to be run as solo tests on daily runs. the change includes: 1. separate the large-memory tests into separate test block (mainly helpful in workflow manual dispatch cases) 2. place all current large memory tests in run solo blocks in order to prevent potential runner OOM failures. Signed-off-by: Ran Shidlansik <[email protected]>
1 parent 3efe841 commit 2c9db1a

File tree

6 files changed

+51
-29
lines changed

6 files changed

+51
-29
lines changed

.github/workflows/daily.yml

+15-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
default: "valgrind,sanitizer,tls,freebsd,macos,alpine,32bit,iothreads,ubuntu,rpm-distros,malloc,specific,fortify,reply-schema,arm"
1616
skiptests:
1717
description: "tests to skip (delete the ones you wanna keep, do not leave empty)"
18-
default: "valkey,modules,sentinel,cluster,unittest"
18+
default: "valkey,modules,sentinel,cluster,unittest,large-memory"
1919
test_args:
2020
description: "extra test arguments"
2121
default: ""
@@ -718,6 +718,12 @@ jobs:
718718
- name: unittest
719719
if: true && !contains(github.event.inputs.skiptests, 'unittest')
720720
run: ./src/valkey-unit-tests --large-memory
721+
- name: large memory tests
722+
if: true && !contains(github.event.inputs.skiptests, 'valkey') && !contains(github.event.inputs.skiptests, 'large-memory')
723+
run: ./runtest --accurate --verbose --dump-logs --large-memory --tags large-memory ${{github.event.inputs.test_args}}
724+
- name: large memory module api tests
725+
if: true && !contains(github.event.inputs.skiptests, 'modules') && !contains(github.event.inputs.skiptests, 'large-memory')
726+
run: CFLAGS='-Werror' ./runtest-moduleapi --verbose --dump-logs --large-memory --tags large-memory ${{github.event.inputs.test_args}}
721727

722728
test-sanitizer-undefined:
723729
runs-on: ubuntu-latest
@@ -755,10 +761,10 @@ jobs:
755761
sudo apt-get install tcl8.6 tclx -y
756762
- name: test
757763
if: true && !contains(github.event.inputs.skiptests, 'valkey')
758-
run: ./runtest --accurate --verbose --dump-logs --large-memory ${{github.event.inputs.test_args}}
764+
run: ./runtest --accurate --verbose --dump-logs ${{github.event.inputs.test_args}}
759765
- name: module api test
760766
if: true && !contains(github.event.inputs.skiptests, 'modules')
761-
run: CFLAGS='-Werror' ./runtest-moduleapi --verbose --dump-logs --large-memory ${{github.event.inputs.test_args}}
767+
run: CFLAGS='-Werror' ./runtest-moduleapi --verbose --dump-logs ${{github.event.inputs.test_args}}
762768
- name: sentinel tests
763769
if: true && !contains(github.event.inputs.skiptests, 'sentinel')
764770
run: ./runtest-sentinel ${{github.event.inputs.cluster_test_args}}
@@ -768,6 +774,12 @@ jobs:
768774
- name: unittest
769775
if: true && !contains(github.event.inputs.skiptests, 'unittest')
770776
run: ./src/valkey-unit-tests --accurate --large-memory
777+
- name: large memory tests
778+
if: true && !contains(github.event.inputs.skiptests, 'valkey') && !contains(github.event.inputs.skiptests, 'large-memory')
779+
run: ./runtest --accurate --verbose --dump-logs --large-memory --tags large-memory ${{github.event.inputs.test_args}}
780+
- name: large memory module api tests
781+
if: true && !contains(github.event.inputs.skiptests, 'modules') && !contains(github.event.inputs.skiptests, 'large-memory')
782+
run: CFLAGS='-Werror' ./runtest-moduleapi --verbose --dump-logs --large-memory --tags large-memory ${{github.event.inputs.test_args}}
771783

772784
test-sanitizer-force-defrag:
773785
runs-on: ubuntu-latest

tests/unit/bitops.tcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ start_server {tags {"bitops"}} {
631631
}
632632

633633
run_solo {bitops-large-memory} {
634-
start_server {tags {"bitops"}} {
634+
start_server {tags {"bitops large-memory"}} {
635635
test "BIT pos larger than UINT_MAX" {
636636
set bytes [expr (1 << 29) + 1]
637637
set bitpos [expr (1 << 32)]

tests/unit/moduleapi/stream.tcl

+27-17
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,6 @@ start_server {tags {"modules"}} {
6161
assert_equal $result $n
6262
}
6363

64-
test {Module stream XADD big fields doesn't create empty key} {
65-
set original_proto [config_get_set proto-max-bulk-len 2147483647] ;#2gb
66-
set original_query [config_get_set client-query-buffer-limit 2147483647] ;#2gb
67-
68-
r del mystream
69-
r write "*4\r\n\$10\r\nstream.add\r\n\$8\r\nmystream\r\n\$5\r\nfield\r\n"
70-
catch {
71-
write_big_bulk 1073741824 ;#1gb
72-
} err
73-
assert {$err eq "ERR StreamAdd failed"}
74-
assert_equal 0 [r exists mystream]
75-
76-
# restore defaults
77-
r config set proto-max-bulk-len $original_proto
78-
r config set client-query-buffer-limit $original_query
79-
} {OK} {large-memory}
80-
8164
test {Module stream iterator} {
8265
r del mystream
8366
set streamid1 [r xadd mystream * item 1 value a]
@@ -174,3 +157,30 @@ start_server {tags {"modules"}} {
174157
assert_equal {OK} [r module unload stream]
175158
}
176159
}
160+
161+
run_solo {stream-large-memory} {
162+
set testmodule [file normalize tests/modules/stream.so]
163+
start_server {tags {"modules large-memory"}} {
164+
r module load $testmodule
165+
166+
test {Module stream XADD big fields doesn't create empty key} {
167+
set original_proto [config_get_set proto-max-bulk-len 2147483647] ;#2gb
168+
set original_query [config_get_set client-query-buffer-limit 2147483647] ;#2gb
169+
170+
r del mystream
171+
r write "*4\r\n\$10\r\nstream.add\r\n\$8\r\nmystream\r\n\$5\r\nfield\r\n"
172+
catch {
173+
write_big_bulk 1073741824 ;#1gb
174+
} err
175+
assert {$err eq "ERR StreamAdd failed"}
176+
assert_equal 0 [r exists mystream]
177+
178+
# restore defaults
179+
r config set proto-max-bulk-len $original_proto
180+
r config set client-query-buffer-limit $original_query
181+
} {OK} {large-memory}
182+
183+
assert_equal {OK} [r module unload stream]
184+
}
185+
}
186+

tests/unit/type/list.tcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ foreach type {listpack quicklist} {
282282
}
283283

284284
run_solo {list-large-memory} {
285-
start_server [list overrides [list save ""] ] {
285+
start_server [list overrides [list save ""] tags {"large-memory"}] {
286286

287287
# test if the server supports such large configs (avoid 32 bit builds)
288288
catch {

tests/unit/type/set.tcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ foreach type {single multiple single_multiple} {
11691169
}
11701170

11711171
run_solo {set-large-memory} {
1172-
start_server [list overrides [list save ""] ] {
1172+
start_server [list overrides [list save ""] tags {"large-memory"}] {
11731173

11741174
# test if the server supports such large configs (avoid 32 bit builds)
11751175
catch {

tests/unit/violations.tcl

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# One XADD with one huge 5GB field
22
# Expected to fail resulting in an empty stream
33
run_solo {violations} {
4-
start_server [list overrides [list save ""] ] {
4+
start_server [list overrides [list save ""] tags {"large-memory"}] {
55
test {XADD one huge field} {
66
r config set proto-max-bulk-len 10000000000 ;#10gb
77
r config set client-query-buffer-limit 10000000000 ;#10gb
@@ -18,7 +18,7 @@ start_server [list overrides [list save ""] ] {
1818
# One XADD with one huge (exactly nearly) 4GB field
1919
# This uncovers the overflow in lpEncodeGetType
2020
# Expected to fail resulting in an empty stream
21-
start_server [list overrides [list save ""] ] {
21+
start_server [list overrides [list save ""] tags {"large-memory"}] {
2222
test {XADD one huge field - 1} {
2323
r config set proto-max-bulk-len 10000000000 ;#10gb
2424
r config set client-query-buffer-limit 10000000000 ;#10gb
@@ -33,7 +33,7 @@ start_server [list overrides [list save ""] ] {
3333
}
3434

3535
# Gradually add big stream fields using repeated XADD calls
36-
start_server [list overrides [list save ""] ] {
36+
start_server [list overrides [list save ""] tags {"large-memory"}] {
3737
test {several XADD big fields} {
3838
r config set stream-node-max-bytes 0
3939
for {set j 0} {$j<10} {incr j} {
@@ -46,7 +46,7 @@ start_server [list overrides [list save ""] ] {
4646

4747
# Add over 4GB to a single stream listpack (one XADD command)
4848
# Expected to fail resulting in an empty stream
49-
start_server [list overrides [list save ""] ] {
49+
start_server [list overrides [list save ""] tags {"large-memory"}] {
5050
test {single XADD big fields} {
5151
r write "*23\r\n\$4\r\nXADD\r\n\$1\r\nS\r\n\$1\r\n*\r\n"
5252
for {set j 0} {$j<10} {incr j} {
@@ -63,7 +63,7 @@ start_server [list overrides [list save ""] ] {
6363
# Gradually add big hash fields using repeated HSET calls
6464
# This reproduces the overflow in the call to ziplistResize
6565
# Object will be converted to hashtable encoding
66-
start_server [list overrides [list save ""] ] {
66+
start_server [list overrides [list save ""] tags {"large-memory"}] {
6767
r config set hash-max-ziplist-value 1000000000 ;#1gb
6868
test {hash with many big fields} {
6969
for {set j 0} {$j<10} {incr j} {
@@ -75,7 +75,7 @@ start_server [list overrides [list save ""] ] {
7575

7676
# Add over 4GB to a single hash field (one HSET command)
7777
# Object will be converted to hashtable encoding
78-
start_server [list overrides [list save ""] ] {
78+
start_server [list overrides [list save ""] tags {"large-memory"}] {
7979
test {hash with one huge field} {
8080
catch {r config set hash-max-ziplist-value 10000000000} ;#10gb
8181
r config set proto-max-bulk-len 10000000000 ;#10gb

0 commit comments

Comments
 (0)