Skip to content

Commit 11ec760

Browse files
committed
refact: fake time using dateoffset
1 parent a8da519 commit 11ec760

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/ci/ci-run-ee-tests-standalone-fake-time-minio.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ export STORAGE_ALLOW_INSECURE=true
2121
echo "Install dependence"
2222
python3 -m pip install --quiet mysql-connector-python
2323

24+
echo "Build dateoffset"
25+
git clone https://github.com/batiati/dateoffset
26+
pushd dateoffset
27+
make
28+
popd
29+
30+
2431
echo "Starting standalone DatabendQuery(faked time: 2 days ago)"
25-
sudo date -s "-2 days"
32+
LD_PRELOAD=./dateoffset/dateoffset.so \
33+
DATE_OFFSET=$(date -d "-2 days" '+%s') \
2634
./scripts/ci/deploy/databend-query-standalone.sh
2735

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

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

3946
pushd "$SCRIPT_PATH/../../tests" || exit

0 commit comments

Comments
 (0)