diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 4c55365be4..fb1b3f7469 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -46,8 +46,9 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh source /home/runner/.profile - tiup update --nightly - tiup playground nightly --tiflash=0 & + tiup update playground + source /home/runner/.profile + tiup playground v4.0.6 --tiflash=0 & - name: Build UI run: | make ui @@ -55,6 +56,10 @@ jobs: NO_MINIMIZE: true CI: true REACT_APP_MIXPANEL_TOKEN: "" + - name: Wait TiUP Playground + run: | + chmod u+x scripts/wait_tiup_playground.sh + scripts/wait_tiup_playground.sh 15 20 - name: Debug TiUP run: | source /home/runner/.profile @@ -62,7 +67,6 @@ jobs: ls /home/runner/.tiup/components/playground/ DATA_PATH=$(ls /home/runner/.tiup/data/) echo $DATA_PATH - tiup playground display echo "==== TiDB Log ====" head -n 3 /home/runner/.tiup/data/$DATA_PATH/tidb-0/tidb.log echo "==== TiKV Log ====" diff --git a/scripts/wait_tiup_playground.sh b/scripts/wait_tiup_playground.sh new file mode 100755 index 0000000000..4c58bbed58 --- /dev/null +++ b/scripts/wait_tiup_playground.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Wait unitl `tiup playground` command runs success + +INTERVAL=$1 +MAX_TIMES=$2 + +if ([ -z "${INTERVAL}" ] || [ -z "${MAX_TIMES}" ]); then + echo "Usage: command " + exit 1 +fi + +source /home/runner/.profile + +for ((i=0; i<${MAX_TIMES}; i++)); do + tiup playground display + if [ $? -eq 0 ]; then + exit 0 + fi + sleep ${INTERVAL} +done + +exit 1 diff --git a/ui/dashboardApp/layout/signin/index.tsx b/ui/dashboardApp/layout/signin/index.tsx index d5cf833698..733f9a3f5c 100644 --- a/ui/dashboardApp/layout/signin/index.tsx +++ b/ui/dashboardApp/layout/signin/index.tsx @@ -220,6 +220,7 @@ function TiDBSignInForm({ successRoute, onClickAlternative }) { } disabled /> { await ppExpect(page).toFill('input#tidb_signin_password', 'any') await ppExpect(page).toClick('button#signin_btn') - await ppExpect(page).toMatch('TiDB authentication failed') + + const failReason = await page.waitForSelector( + 'form#tidb_signin div[data-e2e="password"] div:last-child' + ) + const content = await failReason.evaluate((n) => n.innerText) + console.log('fail reason:', content) + expect(content).toContain('TiDB authentication failed') }, 10 * 1000 )