diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index b9aca80b..b74025a9 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -12,7 +12,7 @@ jobs: # strategy: # fail-fast: false # matrix: - # os: [ macos-12, ubuntu-22.04 ] + # os: [ macos-14, ubuntu-22.04 ] # steps: # - name: Checkout # uses: actions/checkout@v3 @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, ubuntu-22.04] + os: [macos-14, ubuntu-22.04] steps: - name: Checkout uses: actions/checkout@v3 @@ -32,7 +32,7 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$PWD/bin" >> $GITHUB_PATH - name: Unbork mac - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-14' run: | brew install bash echo "/usr/local/bin" >> $GITHUB_PATH @@ -49,11 +49,11 @@ jobs: ./bin/dfx-sns-sale-buy ./bin/dfx-sns-sale-finalize - name: Create lots of SNS - if: matrix.os != 'macos-12' + if: matrix.os != 'macos-14' run: | ./bin/dfx-sns-demo-mksns-parallel -s 10 --config_index_offset 2 -m snsdemo8 - name: Save state - if: matrix.os != 'macos-12' + if: matrix.os != 'macos-14' run: | # Stop the replica to let it persist all its state before we save the state. dfx stop @@ -69,7 +69,7 @@ jobs: echo "Saving state" bin/dfx-snapshot-save --verbose --snapshot state.tar.xz - name: Upload state - if: matrix.os != 'macos-12' + if: matrix.os != 'macos-14' uses: actions/upload-artifact@v3 with: name: snsdemo @@ -81,7 +81,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, ubuntu-22.04] + os: [macos-14, ubuntu-22.04] steps: - name: Checkout uses: actions/checkout@v3 @@ -90,7 +90,7 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$PWD/bin" >> $GITHUB_PATH - name: Unbork mac - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-14' run: | brew install bash echo "/usr/local/bin" >> $GITHUB_PATH @@ -115,6 +115,6 @@ jobs: ./bin/dfx-sns-sale-buy ./bin/dfx-sns-sale-finalize - name: Create lots of SNS - if: matrix.os != 'macos-12' + if: matrix.os != 'macos-14' run: | ./bin/dfx-sns-demo-mksns-parallel -s 10 --config_index_offset 2 -m snsdemo8 diff --git a/bin/dfx-sns-demo-mksns-parallel b/bin/dfx-sns-demo-mksns-parallel index 2436135c..36b545cd 100755 --- a/bin/dfx-sns-demo-mksns-parallel +++ b/bin/dfx-sns-demo-mksns-parallel @@ -73,10 +73,14 @@ create_all_sns() { PROCESSES=() echo "I am $$" for ((i = 0; i < NUM_SNS_TO_MAKE; i++)); do + # Creating wallet canisters in parallel started occasionally failing with + # 0.24.1. When creating 10 in parallel, almost always at least 1 would fail. + # So we create the users outside the background process. + DEMO_USER="snsdemo_$i" + make_user "$DEMO_USER" ( echo "Starting $BASHPID" DEMO_USER="snsdemo_$i" - make_user "$DEMO_USER" become_user "$DEMO_USER" ./bin/dfx-sns-demo-mksns-config --config_index $((CONFIG_INDEX_OFFSET + i)) --unique_logo "$UNIQUE_LOGO" diff --git a/bin/dfx-stock-deploy b/bin/dfx-stock-deploy index 7a5b6fb2..5a099f27 100755 --- a/bin/dfx-stock-deploy +++ b/bin/dfx-stock-deploy @@ -49,6 +49,13 @@ if [ "${PARALLEL_SNS_COUNT:-0}" -gt 0 ]; then dfx-sns-demo-mksns-parallel --network "$DFX_NETWORK" --num_sns "$PARALLEL_SNS_COUNT" --majority snsdemo8 --config_index_offset 2 --unique_logo "$UNIQUE_LOGO" fi +SNS_COUNT="$(dfx canister call nns-sns-wasm list_deployed_snses '(record{})' | idl2json | jq -r '.instances | length')" +EXPECTED_SNS_COUNT="$((2 + PARALLEL_SNS_COUNT))" +if [[ "$SNS_COUNT" != "$EXPECTED_SNS_COUNT" ]]; then + echo "❌ Expected $EXPECTED_SNS_COUNT SNSes. Found $SNS_COUNT" + exit 1 +fi + : Set up ckbtc canisters dfx-ckbtc-import --prefix ckbtc_ dfx-ckbtc-deploy --prefix ckbtc_ --network "$DFX_NETWORK" --yes