Skip to content

Commit

Permalink
Merge pull request #429 from EYBlockchain/david/ping-pong-test-timings
Browse files Browse the repository at this point in the history
Increased timings
  • Loading branch information
Westlad authored Jan 27, 2022
2 parents 9a68643 + c3d2d3b commit 8f39528
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ services:
OPTIMIST_HOST: optimist1
OPTIMIST_PORT: 80
USE_STUBS: 'false' # make sure this flag is the same as in deployer service
RETRIES: 80
command: ['npm', 'run', 'dev']

client2:
Expand Down
34 changes: 22 additions & 12 deletions wallet/docker-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ main() {
if [ ${RUN_SELENIUM_TESTS} -eq 1 ]; then
wait_ready
tmux select-pane -t 1
tmux send-keys "node ../cli/src/proposer.mjs --environment Docker" Enter
sudo touch test/.proposer_log
sudo chown apps test/.proposer_log
sudo touch test/.liquidity-provider_log
sudo chown apps test/.liquidity-provider_log
tmux send-keys "node ../cli/src/proposer.mjs --environment Docker | tee test/.proposer_log" Enter
tmux select-pane -t 2
tmux send-keys "node ../cli/src/liquidity-provider.mjs --environment Docker" Enter
tmux send-keys "node ../cli/src/liquidity-provider.mjs --environment Docker | tee test/.liquidity-provider_log" Enter
tmux select-pane -t 3
sudo touch test/.test_results
sudo chown apps test/.test_results
Expand All @@ -50,6 +54,8 @@ wait_tests_done() {
fi
sleep 10
done
cat test/.proposer_log
cat test/.liquidity-provider_log
cat test/.test_results
testResults=$(cat test/.test_results | grep FAILED)
if [ -z "${testResults}" ]; then
Expand All @@ -68,17 +74,21 @@ wait_ready() {
app_deployed=$(curl http://wallet-test:3010 2> /dev/null | grep favicon)
done
echo "Wallet deployed"
sleep 60
#wscommand='{"jsonrpc": "2.0", "id": 0, "method": "eth_blockNumber"}'
#block=0
#while [ ! -z "${block}" ] && [ "${block}" -lt 36 ]; do
wscommand='{"jsonrpc": "2.0", "id": 0, "method": "eth_blockNumber"}'
block=0
while [ ! -z "${block}" ] && [ "${block}" -lt 300 ]; do
res=$(curl --location --request POST 'http://blockchain1:8546' --header 'Content-Type: application/json' --data-raw '{
"jsonrpc":"2.0",
"method":"eth_blockNumber",
"id":1
}')
#res=$(wscat -c 'ws://blockchain1:8546' -w 1 -x "${wscommand}" | grep result)
#echo "RES ${res}"
#blockHex=$(echo ${res} | awk '{split($0,a,":"); print a[4]}' | tr -d '"' | tr -d '}' | tr -d '0x')
#echo "Busy ${wscommand} ${blockHex} ${block}"
#block=$(printf $((16#${blockHex})))
#sleep 10
#done
echo "RES ${res}"
blockHex=$(echo ${res} | awk '{split($0,a,":"); print a[4]}' | tr -d '"' | tr -d '}' | tr -d '0x')
block=$(printf $((16#${blockHex})))
echo "Busy ${blockHex} ${block}"
sleep 10
done
echo "Contracts deployed"
}

Expand Down
2 changes: 1 addition & 1 deletion wallet/test/tx_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def waitBalanceChange(l1Balance, l2Balance, txParams, nTx, findElementsInstance)
"tokenAddress": tokens['erc20'],
}
while True:
sleep(5)
sleep(10)
tokenRefresh(txTestParams,findElementsInstance)
if niter == 15:
errorMsg = "FAILED - waited too long\n"
Expand Down

0 comments on commit 8f39528

Please sign in to comment.