Skip to content

Commit

Permalink
Get NUM_CPUS from env, pass it to parallel simtest (MystenLabs#9209)
Browse files Browse the repository at this point in the history
  • Loading branch information
mystenmark authored Mar 21, 2023
1 parent f122484 commit f6aedae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/simulator-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ jobs:
NUM_CPUS: 24

steps:
- name: Cargo clean
- name: Environment clean
run: |
cd ~/sui && cargo clean && git restore Cargo.lock
sudo rm -rf /tmp/*.*
- name: Tmpfs clean
run: |
sudo rm -rf /tmp/*.*
- name: Checkout sui repo
run: |
cd ~/sui && git fetch origin && git rebase origin/main
cd ~/sui && git fetch origin main && git rebase origin/main
- name: Install simtest
run: |
Expand Down
9 changes: 5 additions & 4 deletions scripts/simtest/simtest-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Copyright (c) Mysten Labs, Inc.
# SPDX-License-Identifier: Apache-2.0

NUM_CPUS=$(cat /proc/cpuinfo | grep processor | wc -l) # ubuntu
# NUM_CPUS=$(sysctl -n hw.ncpu) # mac
# NUM_CPUS=64 # We can increase this later if needed
if [ -z "$NUM_CPUS" ]; then
NUM_CPUS=$(cat /proc/cpuinfo | grep processor | wc -l) # ubuntu
fi

# filter out some tests that give spurious failures.
TEST_FILTER="(not test(~cli_tests))"
Expand All @@ -21,6 +21,7 @@ MSIM_WATCHDOG_TIMEOUT_MS=60000 \
MSIM_TEST_NUM=30 \
scripts/simtest/cargo-simtest simtest \
--package sui \
--test-threads "$NUM_CPUS" \
--package sui-core \
--profile simtestnightly \
-E "$TEST_FILTER"
Expand All @@ -45,7 +46,7 @@ for SUB_SEED in `seq 1 $NUM_CPUS`; do
--profile simtestnightly \
-E "$TEST_FILTER" > "$LOG_FILE" 2>&1 &

grep -Hn FAIL "$LOG_FILE"
grep -Hn FAIL "$LOG_FILE"
done

# wait for all the jobs to end
Expand Down

0 comments on commit f6aedae

Please sign in to comment.