Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/slow_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,46 @@ jobs:
cp /var/infinity/log/infinity.log* ${ARTIFACTS_DIR}/debug_ubsan_restart_test/
echo "restart_test log(last 1000 lines):" && tail -n 1000 restart_test*.log*

debug_ubsan_pysdk_test:
name: debug_ubsan_pysdk_test
runs-on: [ "self-hosted", "slow-test" ]
needs: debug_build
steps:
- name: Prepare code and artifacts
if: ${{ !cancelled() && !failure() }}
run: |
echo "chown -R ${USER} ${GITHUB_WORKSPACE}" && sudo chown -R ${USER} ${GITHUB_WORKSPACE}
ARTIFACTS_DIR=${RUNNER_WORKSPACE_PREFIX}/artifacts/${GITHUB_REPOSITORY}/${GITHUB_RUN_ID}
echo "ARTIFACTS_DIR=${ARTIFACTS_DIR}" >> ${GITHUB_ENV}
echo "INFINITY_ROOT_PATH=${PWD}" >> ${GITHUB_ENV}
tar --extract --gzip --file=${ARTIFACTS_DIR}/infinity.tgz && git reset --hard && git clean -ffdx
tar --directory=${ARTIFACTS_DIR} --create --file=- cmake-build-debug-ubsan/src/infinity | tar --extract --file=-
sudo mkdir -p /usr/share/infinity/ && sudo cp -rf resource /usr/share/infinity/ && sudo chown -R ${USER} /usr/share/infinity/resource
sudo rm -rf /var/infinity && sudo mkdir -p /var/infinity && sudo chown -R ${USER} /var/infinity

- name: Install pysdk
if: ${{ !cancelled() && !failure() }}
run: uv sync --python 3.11 --frozen --extra test

- name: Start infinity
if: ${{ !cancelled() && !failure() }}
run: |
nohup bash -c "UBSAN_OPTIONS=log_path=pysdk_test_ubsan.log cmake-build-debug-ubsan/src/infinity --config=conf/pytest_parallel_infinity_conf.toml 2> reldeb_parallel_stderr.log" &
./scripts/wait_for_infinity.sh

- name: Run pysdk ubsan test
if: ${{ !cancelled() && !failure() }}
run: |
uv run python3 tools/run_pysdk_remote_infinity_test.py -m ubsan
python3 scripts/timeout_kill.py 10 $(pgrep infinity)

- name: Collect infinity log
if: ${{ !cancelled() }}
run: |
mkdir -p ${ARTIFACTS_DIR}/debug_ubsan_pysdk_test && sudo chown -R ${USER} . && cp pysdk_test*.log* ${ARTIFACTS_DIR}/debug_ubsan_pysdk_test/
cp /var/infinity/log/infinity.log* ${ARTIFACTS_DIR}/debug_ubsan_pysdk_test/
echo "pysdk ubsan test log(last 1000 lines):" && tail -n 1000 pysdk_test*.log*

debug_tsan_cluster_test:
name: debug_tsan_cluster_test
runs-on: [ "self-hosted", "slow-test" ]
Expand Down
4 changes: 4 additions & 0 deletions python/restart_test/test_alter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


class TestAlter:
@pytest.mark.ubsan
def test_alter_simple(self, infinity_runner: InfinityRunner):
table_name = "test_alter1"
config = "test/data/config/restart_test/test_alter/1.toml"
Expand Down Expand Up @@ -76,6 +77,7 @@ def part2(infinity_obj):
part1()
part2()

@pytest.mark.ubsan
@pytest.mark.parametrize(
"flush, flush_mid",
[
Expand Down Expand Up @@ -186,6 +188,7 @@ def part2(infinity_obj):
part1()
part2()

@pytest.mark.ubsan
def test_alter_cleanup_simple(self, infinity_runner: InfinityRunner):
table_name = "test_alter3"
config = "test/data/config/restart_test/test_alter/3.toml"
Expand Down Expand Up @@ -242,6 +245,7 @@ def part2(infinity_obj):

part2()

@pytest.mark.ubsan
def test_restart_after_alter_and_checkpoint(self, infinity_runner: InfinityRunner):
table_name = "test_alter4"
config = "test/data/config/restart_test/test_alter/1.toml"
Expand Down
4 changes: 4 additions & 0 deletions python/restart_test/test_compact.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from infinity_runner import InfinityRunner, infinity_runner_decorator_factory
from common import common_values
from restart_util import LChYDataGenerato
Expand All @@ -6,6 +7,7 @@


class TestCompact:
@pytest.mark.ubsan
def test_restart_after_compact_and_cleanup(self, infinity_runner: InfinityRunner):
config = "test/data/config/restart_test/test_compact/1.toml"
uri = common_values.TEST_LOCAL_HOST
Expand Down Expand Up @@ -50,6 +52,7 @@ def part2(infinity_obj):

part2()

@pytest.mark.ubsan
def test_restart_compact_index(self, infinity_runner: InfinityRunner):
config = "test/data/config/restart_test/test_compact/1.toml"
uri = common_values.TEST_LOCAL_HOST
Expand Down Expand Up @@ -108,6 +111,7 @@ def part2(infinity_obj):

part2()

@pytest.mark.ubsan
def test_compact_restart_repeatedly(self, infinity_runner: InfinityRunner):
config1 = "test/data/config/restart_test/test_compact/1.toml"
config2 = "test/data/config/restart_test/test_compact/2.toml"
Expand Down
2 changes: 2 additions & 0 deletions python/restart_test/test_drop.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
from common import common_values
from infinity_runner import InfinityRunner, infinity_runner_decorator_factory
import time
Expand All @@ -6,6 +7,7 @@

class TestDrop:
# drop table will drop all wal before so delete will not be replayed
@pytest.mark.ubsan
def test_drop_and_replay(self, infinity_runner: InfinityRunner):
config = "test/data/config/restart_test/test_drop/1.toml"
uri = common_values.TEST_LOCAL_HOST
Expand Down
3 changes: 3 additions & 0 deletions python/restart_test/test_fulltext.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def part3(infinity_obj):

part3()

@pytest.mark.ubsan
def test_fulltext_realtime(self, infinity_runner: InfinityRunner):
enwiki_path = "test/data/csv/enwiki_9999.csv"
enwiki_size = 10000
Expand Down Expand Up @@ -352,6 +353,7 @@ def test(infinity_obj):

test()

@pytest.mark.ubsan
def test_fulltext_offline(self, infinity_runner: InfinityRunner):
# should add symbolic link in advance
enwiki_path = "test/data/csv/enwiki_9999.csv"
Expand Down Expand Up @@ -429,6 +431,7 @@ def part2(infinity_obj):

part2()

@pytest.mark.ubsan
def test_fulltext_multi_index(self, infinity_runner: InfinityRunner):
"""Demonstrate querying multiple fulltext indexes on the same column using new field@index syntax."""
config = "test/data/config/restart_test/test_fulltext/1.toml"
Expand Down
1 change: 1 addition & 0 deletions python/restart_test/test_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ def drop_table(infinity_obj):
drop_table()
print("drop table done")

@pytest.mark.ubsan
def test_insert_checkpoint(self, infinity_runner: InfinityRunner):
self._test_insert_checkpoint_inner(infinity_runner, 10)

Expand Down
11 changes: 11 additions & 0 deletions python/restart_test/test_memidx.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import infinity
import pytest
from common import common_values
from infinity_runner import InfinityRunner, infinity_runner_decorator_factory
from infinity import index
Expand All @@ -8,6 +9,7 @@


class TestMemIdx:
@pytest.mark.ubsan
def test_mem_hnsw(self, infinity_runner: InfinityRunner):
config1 = "test/data/config/restart_test/test_memidx/1.toml"
config2 = "test/data/config/restart_test/test_memidx/2.toml"
Expand Down Expand Up @@ -109,6 +111,7 @@ def check():
part3()

# recover cose hnsw from mmap column
@pytest.mark.ubsan
def test_mem_hnsw_cos(self, infinity_runner: InfinityRunner):
# 100M quota in 7.toml not dump index when insert 1024 rows
row_n = 1024
Expand Down Expand Up @@ -161,6 +164,7 @@ def part2(infinity_obj):

part2()

@pytest.mark.ubsan
def test_mem_ivf(self, infinity_runner: InfinityRunner):
config1 = "test/data/config/restart_test/test_memidx/1.toml"
config2 = "test/data/config/restart_test/test_memidx/2.toml"
Expand Down Expand Up @@ -258,6 +262,7 @@ def check():

part3()

@pytest.mark.ubsan
def test_mem_indexer(self, infinity_runner: InfinityRunner):
config1 = "test/data/config/restart_test/test_memidx/1.toml"
config2 = "test/data/config/restart_test/test_memidx/2.toml"
Expand Down Expand Up @@ -369,6 +374,7 @@ def check(rows):

part3()

@pytest.mark.ubsan
def test_mem_bmp(self, infinity_runner: InfinityRunner):
config1 = "test/data/config/restart_test/test_memidx/1.toml"
config2 = "test/data/config/restart_test/test_memidx/2.toml"
Expand Down Expand Up @@ -476,6 +482,7 @@ def check():

part3()

@pytest.mark.ubsan
def test_optimize_from_different_database(self, infinity_runner: InfinityRunner):
infinity_runner.clear()

Expand Down Expand Up @@ -618,6 +625,7 @@ def part3(infinity_obj):

part3()

@pytest.mark.ubsan
def test_recover_memindex_with_dump(self, infinity_runner: InfinityRunner):
infinity_runner.clear()
config1 = "test/data/config/restart_test/test_memidx/4.toml"
Expand Down Expand Up @@ -668,6 +676,7 @@ def part2(infinity_obj):

part2()

@pytest.mark.ubsan
def test_memidx_recover2(self, infinity_runner: InfinityRunner):
infinity_runner.clear()

Expand Down Expand Up @@ -752,6 +761,7 @@ def part2(infinity_obj):

infinity_runner.clear()

@pytest.mark.ubsan
def test_tmp(self, infinity_runner: InfinityRunner):
infinity_runner.clear()

Expand Down Expand Up @@ -793,6 +803,7 @@ def part2(infinity_obj):

part2()

@pytest.mark.ubsan
def test_optimize_empty_index(self, infinity_runner: InfinityRunner):
infinity_runner.clear()
config = "test/data/config/restart_test/test_memidx/6.toml"
Expand Down
6 changes: 3 additions & 3 deletions python/restart_test/test_multiple_index_types_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class TestMultipleIndexTypesImport:
"config, generator, kImportRepeat, kBatchCount, kRunTime",
[
pytest.param("test/data/config/restart_test/test_insert/5.toml", MultiIndexTypesGenerator, 50, 100, 120, marks=pytest.mark.slow),
pytest.param("test/data/config/restart_test/test_insert/4.toml", MultiIndexTypesGenerator, 2, 4, 30, marks=pytest.mark.ubsan),
pytest.param("test/data/config/restart_test/test_insert/5.toml", MultiIndexTypesGenerator, 2, 4, 30, marks=pytest.mark.ubsan),
pytest.param("test/data/config/restart_test/test_insert/6.toml", MultiIndexTypesGenerator, 2, 4, 30, marks=pytest.mark.ubsan),
pytest.param("test/data/config/restart_test/test_insert/4.toml", MultiIndexTypesGenerator, 2, 2, 10, marks=pytest.mark.ubsan),
pytest.param("test/data/config/restart_test/test_insert/5.toml", MultiIndexTypesGenerator, 2, 2, 10, marks=pytest.mark.ubsan),
pytest.param("test/data/config/restart_test/test_insert/6.toml", MultiIndexTypesGenerator, 2, 2, 10, marks=pytest.mark.ubsan),
],
)
def test_multiple_index_types_import_restart(
Expand Down
1 change: 1 addition & 0 deletions python/test_pysdk/test_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def setup_class(request, http):

@pytest.mark.usefixtures("setup_class")
@pytest.mark.usefixtures("suffix")
@pytest.mark.ubsan
class TestInfinity:
@pytest.fixture
def skip_setup_marker(self, request):
Expand Down
1 change: 1 addition & 0 deletions python/test_pysdk/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def setup_class(request, http):

@pytest.mark.usefixtures("setup_class")
@pytest.mark.usefixtures("suffix")
@pytest.mark.ubsan
class TestInfinity:

def test_create_index_IVF(self, suffix):
Expand Down
1 change: 1 addition & 0 deletions python/test_pysdk/test_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def setup_class(request, http):

@pytest.mark.usefixtures("setup_class")
@pytest.mark.usefixtures("suffix")
@pytest.mark.ubsan
class TestInfinity:
def _test_insert_basic(self, suffix):
"""
Expand Down
1 change: 1 addition & 0 deletions python/test_pysdk/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def setup_class(request, http):


@pytest.mark.usefixtures("setup_class")
@pytest.mark.ubsan
class TestInfinity:
@pytest.mark.usefixtures("skip_if_local_infinity")
@pytest.mark.usefixtures("skip_if_http")
Expand Down
1 change: 1 addition & 0 deletions python/test_pysdk/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def setup_class(request, http):

@pytest.mark.usefixtures("setup_class")
@pytest.mark.usefixtures("suffix")
@pytest.mark.ubsan
class TestInfinity:
# def test_version(self):
# self.test_infinity_obj._test_version()
Expand Down
2 changes: 1 addition & 1 deletion test/data/config/restart_test/test_insert/5.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ time_zone = "utc-8"
[network]
[log]
log_to_stdout = true
log_level = "trace"
log_level = "info"

[storage]
optimize_interval = "3s"
Expand Down
2 changes: 1 addition & 1 deletion tools/run_restart_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
parser.add_argument(
"--marker",
type=str,
default="not slow and not ubsan",
default="not slow",
required=False,
)
parser.add_argument(
Expand Down