Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter Integration Step in Build Pipeline Failing #11117

Open
1 task
Sushant2171993 opened this issue Sep 9, 2024 · 2 comments
Open
1 task

Flutter Integration Step in Build Pipeline Failing #11117

Sushant2171993 opened this issue Sep 9, 2024 · 2 comments
Labels
e2-days Effort: < 5 days from.page-issue Reported in a reader-filed concern p2-medium Necessary but not urgent concern. Resolve when possible.

Comments

@Sushant2171993
Copy link

Page URL

https://docs.flutter.dev/testing/integration-tests/

Page source

https://github.com/flutter/website/tree/main/src/content/testing/integration-tests/index.md

Describe the problem

Hi Team,

I'm encountering issues with the integration step in our build pipeline for Flutter applications, which has been running smoothly for the past few months but has recently stopped working. Below is the relevant configuration and script details:

Build Pipeline Configuration:

  • task: ShellScript@2
    displayName: Integration Tests
    condition: eq(${{parameters.runTests}}, True)
    inputs:
    scriptPath: 'distribution/ado/test_container/run-integration-tests.sh'
    disableAutoCwd: true

ChromeDriver Installation Script:

#!/bin/bash
set -e

Fetch the latest stable ChromeDriver version

CHROMEDRIVER_VERSION=$(curl -sS https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE)

echo "Installing ChromeDriver version: $CHROMEDRIVER_VERSION"

CHROMEDRIVER_DIR=/usr/local/bin

Download and install ChromeDriver (for versions 115 and newer)

npx @puppeteer/browsers install chromedriver@$CHROMEDRIVER_VERSION

cp chromedriver/mac-$CHROMEDRIVER_VERSION/chromedriver-mac-x64/chromedriver $CHROMEDRIVER_DIR/.
chmod 755 $CHROMEDRIVER_DIR/chromedriver
rm -rf chromedriver/

echo "ChromeDriver installed successfully."

Integration Test Runner Script:

#!/bin/bash
set -e

Install ChromeDriver

sh ./distribution/ado/test_container/install-chrome-driver.sh

Launch ChromeDriver

chromedriver --port=4444 &
CHDR_PID=$!

directoriesToRunTests=("applications")

for directory in "${directoriesToRunTests[@]}"
do
cd "$directory"
for subDirectory in */
do
cd "$subDirectory"

# Run tests if integration_test directory exists
if [ -d "./integration_test" ]; then
  echo "Running integration tests for: $directory/$subDirectory"
  
  for testFile in $(find integration_test -type f -name '*_test.dart'); do
    $FLUTTER drive --driver=test_driver/integration_test.dart --target=$testFile -d web-server
  done
fi

cd ..

done
cd ..
done
kill $CHDR_PID

Error Logs:

integration_test/daily_deals_test.dart is being served at http://localhost:49327
Unhandled exception:
DriverError: Error while reading FlutterDriver result for command: window.$flutterDriver('{"command":"request_data","timeout":"1200000"}')
Original error: Exception: Expected: not null
Actual:
...
The STDIO streams did not close within 10 seconds of the exit event from process '/bin/bash'. This may indicate a child process inherited the STDIO streams and has not yet exited.
##[error]Bash exited with code '1'.
Finishing: Run Integration test for the changes

The integration tests were working fine until recently. Now, I’m seeing the DriverError and STDIO streams did not close within 10 seconds errors, causing the pipeline to fail. Could you please advise on the best way to resolve this issue?

There is similar issue open - flutter/flutter#148982

Any insights or suggestions would be greatly appreciated asap.

Expected fix

No response

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on docs.flutter.dev.
@sfshaza2
Copy link
Contributor

@parlough, can you weigh in?

@sfshaza2
Copy link
Contributor

@kevmoo, can you weigh in?

@sfshaza2 sfshaza2 added p2-medium Necessary but not urgent concern. Resolve when possible. e2-days Effort: < 5 days labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2-days Effort: < 5 days from.page-issue Reported in a reader-filed concern p2-medium Necessary but not urgent concern. Resolve when possible.
Projects
None yet
Development

No branches or pull requests

2 participants