From b4dcff4636f46b4d0a51e983907d05f614857d1b Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 28 Sep 2022 21:05:42 +0000 Subject: [PATCH 1/6] Improve reliability of async parts of the soft shutdown tests --- tests/unit/soft_shutdown.tcl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/soft_shutdown.tcl b/tests/unit/soft_shutdown.tcl index 893a988f4..48328d72f 100644 --- a/tests/unit/soft_shutdown.tcl +++ b/tests/unit/soft_shutdown.tcl @@ -43,12 +43,14 @@ start_server {tags {"soft_shutdown"} } { start_server {tags {"soft_shutdown"} overrides {soft-shutdown yes} } { test {soft shutdown triggered by SIGINT} { exec kill -SIGINT [s process_id] + after 100 catch {[r ping]} e assert_match {SHUTDOWN PENDING} $e } test {second SIGINT forces a shutdown during a soft shutdown} { exec kill -SIGINT [s process_id] + after 100 catch {[r ping]} e assert_match {*I/O*} $e } From 12516b66accd0057deadd23b41759666f49fcbc1 Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 28 Sep 2022 21:11:11 +0000 Subject: [PATCH 2/6] Fix incorrect default branch --- ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci.yaml b/ci.yaml index 5614be8e6..89c048d1c 100644 --- a/ci.yaml +++ b/ci.yaml @@ -9,7 +9,7 @@ on: build_name: keydb-build arch_types: ["amd64", "arm64"] push: - - branches: [master] + - branches: [keydbpro] workflows: - workflow_type: backend_workflow build_name: keydb-build From f3a7f07537ae7b1a56c8828c04b387fe657a1008 Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 28 Sep 2022 21:44:51 +0000 Subject: [PATCH 3/6] Improve machamp reliability by not overloading test machines --- build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.yaml b/build.yaml index 0500f5b7f..0cfcaa12d 100644 --- a/build.yaml +++ b/build.yaml @@ -21,7 +21,7 @@ machamp: parent: make-build # https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04 builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c - command: ./runtest --clients $(nproc) --verbose --tls + command: ./runtest --clients 2 --verbose --tls cluster-test: type: cmd parent: make-build From ac194e1a63dbce6eeb792402eacc9723c126a348 Mon Sep 17 00:00:00 2001 From: John Sully Date: Thu, 29 Sep 2022 04:25:18 +0000 Subject: [PATCH 4/6] disable tls in machamp --- build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.yaml b/build.yaml index 0cfcaa12d..30784b874 100644 --- a/build.yaml +++ b/build.yaml @@ -21,13 +21,13 @@ machamp: parent: make-build # https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04 builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c - command: ./runtest --clients 2 --verbose --tls + command: ./runtest --clients 4 --verbose --config server-threads 3 cluster-test: type: cmd parent: make-build # https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04 builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c - command: ./runtest-cluster --tls + command: ./runtest-cluster sentinel-test: type: cmd parent: make-build From 5afdab4e1f9a0a30f62db8f07677fe33bae75ae5 Mon Sep 17 00:00:00 2001 From: John Sully Date: Thu, 29 Sep 2022 16:16:18 +0000 Subject: [PATCH 5/6] Remove threads from test as they aren't reliable in machamp --- build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.yaml b/build.yaml index 30784b874..744ae947a 100644 --- a/build.yaml +++ b/build.yaml @@ -21,7 +21,7 @@ machamp: parent: make-build # https://github.sc-corp.net/Snapchat/img/tree/master/keydb/ubuntu-20-04 builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/keydb/keydb-ubuntu-20-04@sha256:cf869a3f5d1de1e1d976bb906689c37b7031938eb68661b844a38c532f27248c - command: ./runtest --clients 4 --verbose --config server-threads 3 + command: ./runtest --clients 4 --verbose cluster-test: type: cmd parent: make-build From ef537cc4d3d09bf8643f97c9c69ae626be2658a0 Mon Sep 17 00:00:00 2001 From: John Sully Date: Thu, 29 Sep 2022 16:51:38 +0000 Subject: [PATCH 6/6] Improve reliability of fragmentation tests --- tests/unit/memefficiency.tcl | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/unit/memefficiency.tcl b/tests/unit/memefficiency.tcl index db18e7128..a30129e4c 100644 --- a/tests/unit/memefficiency.tcl +++ b/tests/unit/memefficiency.tcl @@ -49,10 +49,13 @@ start_server {tags {"defrag"} overrides {appendonly yes auto-aof-rewrite-percent r config set maxmemory 100mb r config set maxmemory-policy allkeys-lru - populate 700000 asdf1 150 - populate 170000 asdf2 300 - after 120 ;# serverCron only updates the info once in 100ms - set frag [s allocator_frag_ratio] + for {set i 0} {$i < 10} {incr i} { + populate 700000 asdf1 150 + populate 170000 asdf2 300 + after 120 ;# serverCron only updates the info once in 100ms + set frag [s allocator_frag_ratio] + if {$frag >= 1.4} {break} + } if {$::verbose} { puts "frag $frag" } @@ -507,11 +510,14 @@ start_server {tags {"defrag"} overrides {server-threads 1 active-replica yes} } r config set active-defrag-ignore-bytes 2mb r config set maxmemory 100mb r config set maxmemory-policy allkeys-lru - populate 700000 asdf1 150 - populate 170000 asdf2 300 - r ping ;# trigger eviction following the previous population - after 120 ;# serverCron only updates the info once in 100ms - set frag [s allocator_frag_ratio] + for {set i 0} {$i < 10} {incr i} { + populate 700000 asdf1 150 + populate 170000 asdf2 300 + r ping ;# trigger eviction following the previous population + after 120 ;# serverCron only updates the info once in 100ms + set frag [s allocator_frag_ratio] + if {$frag >= 1.4} {break} + } if {$::verbose} { puts "frag $frag" }