-
Notifications
You must be signed in to change notification settings - Fork 35
fix(agent): stop scoped-session S3 hang in baseline build + reap hung suites + early ACK #616
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
Merged
Merged
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
c3f2b6f
fix(ecs): write task payload to S3, not inline overrides (#502)
331751e
Merge branch 'main' into fix/502-ecs-payload-s3-pointer
krokoko 85e141d
Merge branch 'main' into fix/502-ecs-payload-s3-pointer
isadeks 6e0db96
fix: enable corepack in the agent image so yarn/pnpm resolve
isadeks bef9b86
wire ECS/Fargate substrate (context-gated) at 32GB/8vCPU for heavy bu…
isadeks c6a2f28
bump ECS Fargate to 64GB/16vCPU + BUILD_VERIFY_TIMEOUT_S=3600
isadeks 5da571e
fix(ecs): map full payload to run_task so channel/build/cedar fields …
isadeks bf0a86d
fix(ecs): grant task role GetSecretValue on bgagent-{linear,jira}-oau…
isadeks 70efb8d
fix(ecs): wire ARTIFACTS_BUCKET_NAME into the Fargate task (ECS-parit…
isadeks b9da937
feat(compute): guard compute_type=ecs against a stack without the ECS…
isadeks 26ec150
fix(cdk): raise BUILD task memory 64→120 GB (max Fargate) — ABCA-662 …
isadeks 9add784
fix(cdk): make ecs-strategy top-of-file import hermetic vs ambient env
isadeks 4acccf3
fix(cdk): grant ec2:DescribeAvailabilityZones to ECS agent task role …
isadeks 209c66a
fix(ecs): grant ECS task role AgentCore Memory access (F-2, ABCA-488-…
a5550eb
docs(bootstrap): correct the ECS ComputeTypes enable instructions
isadeks 86a3f41
fix(errors): classify a build/verify command TIMEOUT (live-caught ABC…
isadeks b91bc5b
fix(agent): ensure claude-code native binary is placed at image build…
isadeks 0bb0d6e
fix(agent): log stdout on run_cmd failure so build-gate failures are …
isadeks 0e25d3d
fix(agent): surface the FAILING line from a parallel build DAG, not j…
isadeks d7d6a02
fix(agent): bound the aws_session concurrency test's Barrier + joins …
isadeks d9aead0
fix(build): add pytest per-test timeout so a hung agent test fails loud
isadeks 32b1370
fix(agent): pytest-timeout method thread→signal so a hung test is act…
isadeks 1ad937d
Merge remote-tracking branch 'upstream/main' into HEAD
isadeks 8e30da4
Merge branch 'main' into fix/502-ecs-payload-s3-pointer
isadeks ce93b62
fix(ecs): remove dead ECS_PAYLOAD_OBJECT_KEY_PREFIX export (review B1)
isadeks 8644f9c
docs+feat: address review nits N1–N4 on the ECS substrate
isadeks 1c5e64a
Merge branch 'main' into fix/502-ecs-payload-s3-pointer
krokoko cc93150
Merge branch 'fix/502-ecs-payload-s3-pointer' into pr/ecs-substrate-h…
isadeks d258e76
style: ruff-format the N4 payload-key block (fix build-mutation failure)
isadeks ca8af9a
fix+docs: WARN on dropped task_started_at (HITL parity) + defensive m…
isadeks faaf395
Merge remote-tracking branch 'upstream/main' into pr/ecs-substrate-ha…
isadeks c2a3f26
Merge branch 'main' into pr/ecs-substrate-hardening
isadeks dd7146f
fix(agent): stop scoped-session S3 hang in the baseline build + reap …
isadeks 68c9735
fix(ecs): address #596 review — drop over-privileged artifacts grant …
isadeks 1ebf6f9
fix(agent): address #616 review — real conftest-scrub guard + watchdo…
isadeks 86ab249
Merge branch 'main' into pr/ecs-substrate-hardening
isadeks fc328ef
fix(ecs): address #596 re-review nits — stale parity comments + WARN …
isadeks b2ca9c8
test(agent): address #616 review N4 + N5 — pin early-ACK ordering + d…
isadeks 88e0ac8
Merge branch 'main' into pr/ecs-substrate-hardening
isadeks f5e4bba
Merge branch 'main' into pr/ecs-substrate-hardening
isadeks 8f8663f
Merge remote-tracking branch 'upstream/main' into cascade-pr-ecs-subs…
isadeks b8bcff8
Merge branch 'cascade-pr-ecs-substrate-hardening' into cascade-pr-age…
isadeks 1e1896f
Merge branch 'cascade-pr-agent-build-robustness' into cascade-pr-ecs-…
isadeks 6f2fca3
Merge branch 'cascade-pr-ecs-test-hygiene' into cascade-616
isadeks 28b437f
Merge remote-tracking branch 'upstream/pr/ecs-substrate-hardening' in…
isadeks 3d5c89f
Merge branch 'c597' into c598
isadeks 7d0b705
Merge branch 'c598' into c616
isadeks f9d0f75
Merge branch 'main' into pr/ecs-substrate-hardening
isadeks 35cbf7f
Merge branch 'pr/ecs-substrate-hardening' into pr/agent-build-robustness
isadeks 613fc1e
Merge branch 'pr/agent-build-robustness' into pr/ecs-test-hygiene
isadeks b99f049
Merge branch 'main' into pr/agent-build-robustness
isadeks 9c8ea42
Merge branch 'pr/agent-build-robustness' into pr/ecs-test-hygiene
isadeks e6cd934
Merge branch 'main' into pr/agent-build-robustness
isadeks c1cfc73
Merge branch 'pr/agent-build-robustness' into pr/ecs-test-hygiene
isadeks 518b821
Merge branch 'pr/ecs-test-hygiene' into fix/615-ecs-scoped-session-hang
isadeks 5ef12a0
Merge remote-tracking branch 'upstream/main' into pr598-resolve-confl…
isadeks 6b73969
Merge branch 'pr/ecs-test-hygiene' into fix/615-ecs-scoped-session-hang
isadeks 4693bc9
Merge branch 'main' into fix/615-ecs-scoped-session-hang
isadeks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| """Fixture-free regression guard for the ECS test-hang scrub (#615 / #616 B1). | ||
|
|
||
| This module deliberately has NO local autouse fixture. It exists to prove that | ||
| conftest's ``_clean_env`` autouse fixture strips ``AGENT_SESSION_ROLE_ARN`` from | ||
| the environment before each test — the exact line the #615 fix adds to | ||
| ``_AGENT_ENV_VARS``. | ||
|
|
||
| Why a separate module: ``test_aws_session.py`` has its OWN autouse ``_reset`` | ||
| fixture that does ``monkeypatch.delenv(SESSION_ROLE_ARN_ENV)``, so a guard placed | ||
| there passes even if the conftest scrub is deleted (it asserts what the local | ||
| fixture guarantees, not what the fix does — #616 review B1). Here, only conftest's | ||
| ``_clean_env`` is in play. | ||
|
|
||
| Why set the var at MODULE IMPORT time (not in the test body): pytest autouse | ||
| fixtures run during test *setup*, before the body executes — so a | ||
| ``monkeypatch.setenv`` inside the test can't be scrubbed by them. Poisoning the | ||
| process env at import time (before any fixture runs) means the conftest scrub is | ||
| the only thing that can clear it by the time a test body reads it. Remove the | ||
| ``AGENT_SESSION_ROLE_ARN`` line from conftest's ``_AGENT_ENV_VARS`` and BOTH tests | ||
| below fail — a true bidirectional guard. | ||
|
|
||
| The bug this guards: with ``AGENT_SESSION_ROLE_ARN`` set, ``aws_session`` | ||
| resolves a *scoped* session and ``tenant_client`` returns ``session.client(...)``, | ||
| bypassing a ``@patch("boto3.client")`` mock. A mocked test (e.g. | ||
| ``test_attachments``) then makes a REAL S3 call that hangs forever on the ECS | ||
| network (no egress) in a socket read SIGALRM can't interrupt — stalling the whole | ||
| ``mise run build``. | ||
| """ | ||
|
|
||
| import os | ||
|
|
||
| from aws_session import SESSION_ROLE_ARN_ENV, is_scoped | ||
|
|
||
| # Poison the process env at import time — BEFORE any fixture runs. The conftest | ||
| # `_clean_env` autouse must scrub this for the assertions below to hold. | ||
| os.environ[SESSION_ROLE_ARN_ENV] = "arn:aws:iam::123456789012:role/leaked-from-parent-env" | ||
|
|
||
|
|
||
| def test_conftest_scrubs_session_role_arn(): | ||
| # If conftest's _clean_env strips AGENT_SESSION_ROLE_ARN, it is gone here even | ||
| # though the module poisoned it at import time. If the scrub line is removed, | ||
| # this fails — the guard the #615 fix actually needs. | ||
| assert os.environ.get(SESSION_ROLE_ARN_ENV) is None | ||
|
|
||
|
|
||
| def test_session_resolves_unscoped_when_scrubbed(): | ||
| # With the var scrubbed (and the cache reset, both by conftest _clean_env) a | ||
| # bare get_session() must be unscoped — the path where boto3.client mocks | ||
| # intercept, so no real S3 call is made and nothing hangs. | ||
| assert is_scoped() is False |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.