shahar1 opened a new pull request, #73707: URL: https://github.com/apache/airflow/pull/73707
Two Amazon provider unit tests exercise boto's "no credentials" path and only cleared the credential environment variables, so the default credential chain kept walking: - `test_raise_no_creds_default_credentials_strategy` and `test_get_s3fs_anonymous` fail on any EC2-hosted runner: the chain reaches the instance role through IMDS (`Found credentials from IAM Role: ...`), so no `NoCredentialsError` is raised and s3fs is created with `anon=False`. - `test_get_s3fs_anonymous` additionally wiped every `AWS*` variable, including the autouse fixture's empty `AWS_CONFIG_FILE` / `AWS_SHARED_CREDENTIALS_FILE`, so it also read the developer's `~/.aws` (with an `aws login` profile it dies with `MissingDependencyException: ... botocore[crt]`). Both tests now set `AWS_EC2_METADATA_DISABLED=true` (honoured by botocore and aiobotocore), and the S3 filesystem test drops only the four credential variables so the fixture's isolation stays in place. Found while running the CI on self-hosted EC2 runners; also reproduced locally with an `~/.aws/config` present. Checks run: `prek run --from-ref upstream/main --to-ref HEAD --stage pre-commit` — passed; `uv run --project providers/amazon pytest providers/amazon/tests/unit/amazon/aws/fs/test_s3.py providers/amazon/tests/unit/amazon/aws/hooks/test_base_aws.py::test_raise_no_creds_default_credentials_strategy` — 4 passed (fails before the change on a host with `~/.aws/config`). --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Fable 5.1) Generated-by: Claude Code (Fable 5.1) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
