Skip to content

Commit

Permalink
Filter flaky tests, enable ignored simtest, set USE_MOCK_CRYPTO=1 (#8843
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mystenmark authored Mar 4, 2023
1 parent 07cd4f2 commit 88f3afd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/simulator-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
simtest:
timeout-minutes: 120
runs-on: [ubuntu-ghcloud]
env:
RUST_LOG: off
# Runs tests much faster - disables signing and verification
USE_MOCK_CRYPTO: 1

steps:
- name: Checkout sui repo main branch
Expand All @@ -44,12 +48,10 @@ jobs:

- name: Build simtest
run: |
export RUST_LOG=off
./scripts/simtest/cargo-simtest simtest build
- name: Run simtest
run: |
export RUST_LOG=off
./scripts/simtest/simtest-run.sh
notify:
Expand Down
36 changes: 22 additions & 14 deletions scripts/simtest/simtest-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,41 @@
NUM_CPUS=$(cat /proc/cpuinfo | grep processor | wc -l) # ubuntu
# NUM_CPUS=$(sysctl -n hw.ncpu) # mac

# filter out some tests that give spurious failures.
TEST_FILTER="(not test(test_move_call_args_linter_command)) & (not test(test_package_publish_command))"

DATE=$(date +%s)

# TODO: increase to 30, 1000 respectively after workflow is debugged.
export MSIM_TEST_NUM=30
export SIM_STRESS_TEST_DURATION_SECS=1000
export SIM_STRESS_TEST_DURATION_SECS=300

SEED="$DATE"
# LOG_FILE="log-$SEED"

# This command runs many different tests, so it already uses all CPUs fairly efficiently, and
# don't need to be done inside of the for loop below.
# TODO: this logs directly to stdout since it is not being run in parallel. is that ok?
MSIM_TEST_SEED="$SEED" MSIM_WATCHDOG_TIMEOUT_MS=60000 scripts/simtest/cargo-simtest simtest --package sui --package sui-core --profile simtestnightly
MSIM_TEST_SEED="$SEED" \
MSIM_WATCHDOG_TIMEOUT_MS=60000 \
scripts/simtest/cargo-simtest simtest \
--package sui \
--package sui-core \
--profile simtestnightly

for SUB_SEED in `seq 1 $NUM_CPUS`; do
SEED="$SUB_SEED$DATE"
#LOG_FILE="log-$SEED"
echo "Iteration $SUB_SEED using MSIM_TEST_SEED=$SEED" # logging to $LOG_FILE"

# TODO: currently this only runs one test, (`test_simulated_load_basic`).
# we need to add `--run-ignored all` in order to enable the ignored tests.
# However, the ignored tests are totally broken right now because of
# https://github.com/MystenLabs/sui/pull/8244.
#
# Note that because of --no-capture, even though we are running many tests, they will be
# serialized here. So we still need the for loop / backgrounding.
MSIM_TEST_SEED="$SEED" MSIM_TEST_NUM=1 MSIM_WATCHDOG_TIMEOUT_MS=60000 scripts/simtest/cargo-simtest simtest --package sui-benchmark --test-threads 1 --profile simtestnightly & # > "$LOG_FILE" 2>&1 &
echo "Iteration $SUB_SEED using MSIM_TEST_SEED=$SEED"

# --test-threads 1 is important: parallelism is achieved via the for loop
MSIM_TEST_SEED="$SEED" \
MSIM_TEST_NUM=1 \
MSIM_WATCHDOG_TIMEOUT_MS=60000 \
scripts/simtest/cargo-simtest simtest \
--package sui-benchmark \
--run-ignored all \
--test-threads 1 \
--profile simtestnightly \
-E "$TEST_FILTER" &
done

# wait for all the jobs to end
Expand Down

0 comments on commit 88f3afd

Please sign in to comment.