mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-12 10:55:46 +02:00
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:
parent
57441f9863
commit
84d4ba4d69
6 changed files with 15 additions and 14 deletions
4
.github/actions/regression-tests/action.yml
vendored
4
.github/actions/regression-tests/action.yml
vendored
|
@ -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}}"
|
||||||
|
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -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
|
||||||
|
|
4
.github/workflows/regression-tests.yml
vendored
4
.github/workflows/regression-tests.yml
vendored
|
@ -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
|
||||||
|
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -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: |
|
||||||
|
|
|
@ -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]
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue