chore(regression): test bptree on regression pytests (#1963)

* chore(regression): test bptree on regression pytests

1. stop passing the flag use_zset_tree as it is true on default
2. fix ci test to run replication tests
3. change replication tests seeder to sometimes add more than 128 values
   to zset to test the pbtree impl

Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
adiholden 2023-10-02 17:07:50 +03:00 committed by GitHub
parent 57441f9863
commit 84d4ba4d69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 14 deletions

View file

@ -39,10 +39,10 @@ runs:
pytest -m "${{inputs.filter}}" --json-report --json-report-file=report.json dragonfly --ignore=dragonfly/replication_test.py --log-cli-level=INFO pytest -m "${{inputs.filter}}" --json-report --json-report-file=report.json dragonfly --ignore=dragonfly/replication_test.py --log-cli-level=INFO
- name: Run PyTests replication test - name: Run PyTests replication test
if: ${{ inputs.run-only-on-ubuntu-latest == 'false' || matrix.runner == 'ubuntu-latest' }} if: ${{ inputs.run-only-on-ubuntu-latest == 'true' || (inputs.run-only-on-ubuntu-latest == 'false' && matrix.runner == 'ubuntu-latest') }}
shell: bash shell: bash
run: | run: |
echo "Running PyTests replication test with flag: ${{ inputs.run-only-on-ubuntu-latest }}" echo "Running PyTests replication test"
cd ${GITHUB_WORKSPACE}/tests cd ${GITHUB_WORKSPACE}/tests
# used by PyTests # used by PyTests
export DRAGONFLY_PATH="${GITHUB_WORKSPACE}/${{inputs.build-folder-name}}/${{inputs.dfly-executable}}" export DRAGONFLY_PATH="${GITHUB_WORKSPACE}/${{inputs.build-folder-name}}/${{inputs.dfly-executable}}"

View file

@ -104,8 +104,8 @@ jobs:
#GLOG_logtostderr=1 GLOG_vmodule=transaction=1,engine_shard_set=1 #GLOG_logtostderr=1 GLOG_vmodule=transaction=1,engine_shard_set=1
GLOG_logtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 ctest -V -L DFLY GLOG_logtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 ctest -V -L DFLY
echo "Running tests with --force_epoll and --use_zset_tree" echo "Running tests with --force_epoll"
FLAGS_force_epoll=true FLAGS_use_zset_tree=true ctest -V -L DFLY FLAGS_force_epoll=true ctest -V -L DFLY
echo "Running tests with --cluster_mode=emulated" echo "Running tests with --cluster_mode=emulated"
FLAGS_cluster_mode=emulated ctest -V -L DFLY FLAGS_cluster_mode=emulated ctest -V -L DFLY

View file

@ -2,7 +2,7 @@ name: Regression Tests
on: on:
schedule: schedule:
- cron: '0 0/3 * * *' - cron: "0 0/3 * * *"
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@ -40,5 +40,5 @@ jobs:
with: with:
dfly-executable: dragonfly dfly-executable: dragonfly
gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }} gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }}
run-only-on-ubuntu-latest: true run-only-on-ubuntu-latest: false
build-folder-name: build build-folder-name: build

View file

@ -137,7 +137,7 @@ jobs:
with: with:
dfly-executable: dragonfly-x86_64 dfly-executable: dragonfly-x86_64
gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }} gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }}
run-only-on-ubuntu-latest: false run-only-on-ubuntu-latest: true
build-folder-name: build-opt build-folder-name: build-opt
- name: Save artifacts - name: Save artifacts
run: | run: |

View file

@ -154,8 +154,7 @@ class DflyInstance:
if self.dynamic_port: if self.dynamic_port:
self._port = None self._port = None
base_args = [] all_args = self.format_args(self.args)
all_args = self.format_args(self.args) + base_args
logging.debug(f"Starting instance with arguments {all_args} from {self.params.path}") logging.debug(f"Starting instance with arguments {all_args} from {self.params.path}")
run_cmd = [self.params.path, *all_args] run_cmd = [self.params.path, *all_args]

View file

@ -166,10 +166,12 @@ class CommandGenerator:
) )
return ("v0", 0, "v1", 0) + tuple(itertools.chain(*elements)) return ("v0", 0, "v1", 0) + tuple(itertools.chain(*elements))
elif t == ValueType.ZSET: elif t == ValueType.ZSET:
# Random sequnce of k-letter keys and int score for ZSET # Random sequnce of k-letter members and int score for ZADD
elements = ( # The length of the sequence will vary between val_size/4 and 130. This ensures that we test both the ZSET implementation with Lispack and the bptree.
(random.randint(0, self.val_size), rand_str()) for _ in range(self.val_size // 4) value_sizes = [self.val_size // 4, 130]
) probabilities = [4, 1]
value_size = random.choices(value_sizes, probabilities)[0]
elements = ((random.randint(0, self.val_size), rand_str()) for _ in range(value_size))
return tuple(itertools.chain(*elements)) return tuple(itertools.chain(*elements))
elif t == ValueType.JSON: elif t == ValueType.JSON: