mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-09-14 13:30:11 +00:00

* Copy some boilerplate from the other stability tests. * Fix a copy+paste error in run.sh. * Copy over some stability test boilerplate go code. * Run kaspad in the background. * Catch panics and initialize the RPC client. * Mine enough blocks to fund filling up the mempool. * Extract coinbase transactions out of the generated blocks. * Tidy up a bit. * Implement submitting transactions. * Lower the amount of outputs in each transaction. * Verify that the mempool size has the expected amount of transactions. * Pregenerate enough funds before submitting the first transaction so that block creation doesn't interfere with the test. * Empty mempool out by continuously adding blocks to the DAG. * Handle orphan transactions when overfilling the mempool. * Increase mempoolSizeLimit to 1m. * Fix a comment. * Fix a comment. * Add mempool-limits to run-slow.sh. * Rename generateTransactionsWithLotsOfOutputs to generateTransactionsWithMultipleOutputs. * Rename generateCoinbaseTransaction to mineBlockAndGetCoinbaseTransaction. * Make generateFundingCoinbaseTransactions return an object instead of store a global variable. * Convert mempool-limits into a Go test. * Convert panics to t.Fatalfs. * Fix a comment. * Increase mempoolSizeLimit to 1m. * Run TestMempoolLimits only if RUN_STABILITY_TESTS is set. * Move the run of mempool-limits in run-slow.sh. * Add a comment above fundingCoinbaseTransactions. * Make a couple of stylistic changes. * Use transactionhelper.CoinbaseTransactionIndex instead of hardcoding 0. * Make uninteresting errors print %+v instead of %s. Co-authored-by: Svarog <feanorr@gmail.com>
30 lines
609 B
Bash
Executable File
30 lines
609 B
Bash
Executable File
#!/bin/bash
|
|
|
|
APPDIR=/tmp/kaspad-temp
|
|
KASPAD_RPC_PORT=29587
|
|
|
|
rm -rf "${APPDIR}"
|
|
|
|
kaspad --simnet --appdir="${APPDIR}" --rpclisten=0.0.0.0:"${KASPAD_RPC_PORT}" --profile=6061 &
|
|
KASPAD_PID=$!
|
|
|
|
sleep 1
|
|
|
|
RUN_STABILITY_TESTS=true go test ../ -- --rpc-address=127.0.0.1:"${KASPAD_RPC_PORT}" --profile=7000
|
|
TEST_EXIT_CODE=$?
|
|
|
|
kill $KASPAD_PID
|
|
|
|
wait $KASPAD_PID
|
|
KASPAD_EXIT_CODE=$?
|
|
|
|
echo "Exit code: $TEST_EXIT_CODE"
|
|
echo "Kaspad exit code: $KASPAD_EXIT_CODE"
|
|
|
|
if [ $TEST_EXIT_CODE -eq 0 ] && [ $KASPAD_EXIT_CODE -eq 0 ]; then
|
|
echo "mempool-limits test: PASSED"
|
|
exit 0
|
|
fi
|
|
echo "mempool-limits test: FAILED"
|
|
exit 1
|