Skip to content

refactor: fake time in CI using dateoffset #16272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
35 changes: 15 additions & 20 deletions .github/workflows/reuse.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,26 +275,21 @@ jobs:
with:
name: test-stateful-standalone-linux

# Temporarily commented out, since this job is run on self-hosted, may
# bring troubles to other jobs run on self-hosted.
#
# Maybe we could patch `libfaketime` and let it support jemalloc?
#
# test_ee_standalone_fake_time:
# needs: [build, check]
# runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/setup_license
# with:
# runner_provider: ${{ inputs.runner_provider }}
# - uses: ./.github/actions/test_ee_standalone_fake_time_linux
# timeout-minutes: 10
# - name: Upload failure
# if: failure()
# uses: ./.github/actions/artifact_failure
# with:
# name: test-stateful-standalone-fake-time-linux
test_ee_standalone_fake_time:
needs: [build, check]
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_license
with:
runner_provider: ${{ inputs.runner_provider }}
- uses: ./.github/actions/test_ee_standalone_fake_time_linux
timeout-minutes: 10
- name: Upload failure
if: failure()
uses: ./.github/actions/artifact_failure
with:
name: test-stateful-standalone-fake-time-linux

test_ee_management_mode:
needs: [ build, check ]
Expand Down
13 changes: 10 additions & 3 deletions scripts/ci/ci-run-ee-tests-standalone-fake-time-minio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ export STORAGE_ALLOW_INSECURE=true
echo "Install dependence"
python3 -m pip install --quiet mysql-connector-python

echo "Build dateoffset"
git clone https://github.com/batiati/dateoffset
pushd dateoffset
make
popd


echo "Starting standalone DatabendQuery(faked time: 2 days ago)"
sudo date -s "-2 days"
LD_PRELOAD=./dateoffset/dateoffset.so \
DATE_OFFSET=$(date -d "-2 days" '+%s') \
./scripts/ci/deploy/databend-query-standalone.sh

SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
Expand All @@ -32,8 +40,7 @@ echo "Preparing data (faked time)"
./databend-test --mode 'standalone' --run-dir 8_faked_time_prepare

popd
echo "Starting standalone DatabendQuery"
sudo date -s "+2 days"
echo "Starting standalone DatabendQuery (Normal time)"
./scripts/ci/deploy/databend-query-standalone.sh

pushd "$SCRIPT_PATH/../../tests" || exit
Expand Down
Loading