diff --git a/.github/workflows/aggregator-stress-test.yml b/.github/workflows/aggregator-stress-test.yml index 710e8fd0f1a..0ca28dea3c1 100644 --- a/.github/workflows/aggregator-stress-test.yml +++ b/.github/workflows/aggregator-stress-test.yml @@ -52,20 +52,26 @@ jobs: workflow: ci.yml workflow_conclusion: success + - name: Download test runners + uses: dawidd6/action-download-artifact@v3 + with: + name: mithril-tooling-Linux-X64 + path: ./bin + commit: ${{ inputs.commit_sha }} + workflow: ci.yml + workflow_conclusion: success + - name: Set permissions shell: bash working-directory: ./bin - run: chmod +x ./mithril-aggregator - - - name: Build the aggregator stress test - working-directory: mithril-test-lab/mithril-end-to-end - run: make build + run: | + chmod +x ./mithril-aggregator + chmod +x ./load-aggregator - name: Run the aggregator stress test - working-directory: mithril-test-lab/mithril-end-to-end run: | - ./load-aggregator ${{ steps.prepare.outputs.debug_level }} \ - --cardano-cli-path script/mock-cardano-cli \ - --aggregator-dir ../../bin \ + ./bin/load-aggregator ${{ steps.prepare.outputs.debug_level }} \ + --cardano-cli-path ./mithril-test-lab/mithril-end-to-end/script/mock-cardano-cli \ + --aggregator-dir ./bin \ --num-signers=${{ inputs.num_signers }} \ --num-clients=${{ inputs.num_clients }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cfa51ff7f7..07430887269 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: # We separate the build in 2 steps as we want to avoid side effects with Rust feature unification. - name: Cargo build - Tooling shell: bash - run: cargo build --release -p mithril-end-to-end + run: cargo build --release --bin mithril-end-to-end --bin load-aggregator - name: Build Mithril workspace & publish artifacts uses: ./.github/workflows/actions/build-upload-mithril-artifact @@ -58,8 +58,10 @@ jobs: - name: Publish End-to-end runner (${{ runner.os }}-${{ runner.arch }}) uses: actions/upload-artifact@v4 with: - name: mithril-end-to-end-${{ runner.os }}-${{ runner.arch }} - path: target/release/mithril-end-to-end + name: mithril-tooling-${{ runner.os }}-${{ runner.arch }} + path: | + target/release/mithril-end-to-end + target/release/load-aggregator if-no-files-found: error - name: Prepare test lab eras @@ -302,7 +304,7 @@ jobs: - name: Download rust test runner uses: actions/download-artifact@v4 with: - name: mithril-end-to-end-${{ runner.os }}-${{ runner.arch }} + name: mithril-tooling-${{ runner.os }}-${{ runner.arch }} path: ./ - run: | diff --git a/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs b/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs index dd462be0f24..ecfac461ee3 100644 --- a/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs +++ b/mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs @@ -58,6 +58,16 @@ pub async fn bootstrap_aggregator( ) .await?; + restart_aggregator_and_move_one_epoch_forward(&mut aggregator, current_epoch, args).await?; + + fake_signer::try_register_signer_until_registration_round_is_open( + &aggregator, + &signers_fixture.signers()[0], + *current_epoch + 1, + Duration::from_secs(60), + ) + .await?; + info!(">> Send the Signer Key Registrations payloads for the genesis signers"); let errors = fake_signer::register_signers_to_aggregator( &aggregator, @@ -66,21 +76,17 @@ pub async fn bootstrap_aggregator( ) .await?; assert_eq!(0, errors); - aggregator.stop().await.unwrap(); - - info!(">> Move one epoch forward in order to issue the genesis certificate"); - *current_epoch += 1; - fake_chain::set_epoch(&args.mock_epoch_file_path(), *current_epoch); - info!(">> Restarting the aggregator still with a large run interval"); - aggregator.serve().unwrap(); - wait::for_http_response( - &format!("{}/epoch-settings", aggregator.endpoint()), - Duration::from_secs(10), - "Waiting for the aggregator to start", + fake_signer::try_register_signer_until_registration_round_is_open( + &aggregator, + &signers_fixture.signers()[0], + *current_epoch + 1, + Duration::from_secs(60), ) .await?; + restart_aggregator_and_move_one_epoch_forward(&mut aggregator, current_epoch, args).await?; + info!(">> Send the Signer Key Registrations payloads for next genesis signers"); let errors = fake_signer::register_signers_to_aggregator( &aggregator, @@ -115,3 +121,26 @@ pub async fn bootstrap_aggregator( Ok(aggregator) } + +async fn restart_aggregator_and_move_one_epoch_forward( + aggregator: &mut Aggregator, + current_epoch: &mut Epoch, + args: &AggregatorParameters, +) -> StdResult<()> { + info!(">> Stop the aggregator to move one epoch forward"); + aggregator.stop().await.unwrap(); + + *current_epoch += 1; + fake_chain::set_epoch(&args.mock_epoch_file_path(), *current_epoch); + + info!(">> Restarting the aggregator with a large run interval"); + aggregator.serve().unwrap(); + wait::for_http_response( + &format!("{}/epoch-settings", aggregator.endpoint()), + Duration::from_secs(10), + "Waiting for the aggregator to start", + ) + .await?; + + Ok(()) +} diff --git a/mithril-test-lab/mithril-end-to-end/src/stress_test/wait.rs b/mithril-test-lab/mithril-end-to-end/src/stress_test/wait.rs index 5fb9f00d3cf..b387efc8d6a 100644 --- a/mithril-test-lab/mithril-end-to-end/src/stress_test/wait.rs +++ b/mithril-test-lab/mithril-end-to-end/src/stress_test/wait.rs @@ -48,7 +48,7 @@ where } _ => request_first_list_item_with_expected_size::(url, expected_size).await, }, - Err(err) => Err(anyhow!(err).context("Request to `{url}` failed")), + Err(err) => Err(anyhow!(err).context(format!("Request to `{url}` failed"))), } }