fix(batch): ListJobs semantics, tag read/write parity, queue validation#1993
Merged
Conversation
…validation
ListJobs (crates/fakecloud-batch/src/service.rs):
- Default to RUNNING when no jobStatus is given (AWS: "if you don't
specify a status, only RUNNING jobs are returned") instead of returning
every status.
- Honor the arrayJobId / multiNodeJobId selectors and require exactly one
of jobQueue / arrayJobId / multiNodeJobId, matching AWS.
- Paginate via maxResults (<=100) + an opaque nextToken.
- Emit full JobSummary fields (jobArn/statusReason/startedAt/stoppedAt/
container/arrayProperties/jobDefinition), not just jobId/name/status/createdAt.
Tags: create wrote tags inline on the resource while TagResource/UntagResource
wrote a separate per-ARN store, so Describe* and ListTagsForResource disagreed
(terraform tag updates never converged). Seed the store from inline create
tags and overlay it on every Describe* read, making the store authoritative.
Also: SubmitJob now rejects a non-existent jobQueue (AWS ClientException), and
DescribeComputeEnvironments reports containerOrchestrationType ("ECS").
Tests: new tags-parity test; ListJobs default-RUNNING + arrayJobId selector +
no-selector-error assertions; existing tests updated to create their queue.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
AWS Batch correctness cluster from the 2026-06-27 bug-hunt (Tier 1: findings 1.1-1.6).
ListJobs (
crates/fakecloud-batch/src/service.rs)RUNNINGwhen nojobStatusis given. AWS: "If you don't specify a status, only RUNNING jobs are returned." Previously returned every status -> pollers over-counted running jobs.arrayJobId/multiNodeJobIdselectors and require exactly one ofjobQueue/arrayJobId/multiNodeJobId(AWS rejects otherwise). Enumerating an array job's children works now.maxResults(<=100) + opaquenextToken.JobSummary(jobArn/statusReason/startedAt/stoppedAt/container/arrayProperties/jobDefinition), not just jobId/name/status/createdAt.Tags single-store (1.3)
Create wrote tags inline on the resource;
TagResource/UntagResourcewrote a separate per-ARN store;Describe*read inline only andListTagsForResourceread the store only — so the two diverged and terraform tag updates never converged ("inconsistent result after apply"). Now the store is authoritative: create seeds it from inline tags, and everyDescribe*overlays it.1.6
SubmitJobrejects a non-existentjobQueue(AWSClientException);DescribeComputeEnvironmentsreportscontainerOrchestrationType("ECS").Tests
New tags-parity test (create-inline -> ListTags; TagResource -> Describe; containerOrchestrationType). ListJobs default-RUNNING + arrayJobId-selector + no-selector-error assertions. Existing tests updated to create their queue first.
cargo test -p fakecloud-batch18 pass; batch control-plane + CFN e2e green.Summary by cubic
Aligns fake AWS Batch API with real AWS behavior to improve polling accuracy and tag consistency. Fixes ListJobs semantics, unifies tag read/write, validates queues, and adds a missing compute environment field.
Describe*andListTagsForResourcein sync (fixes Terraform tag drift).jobQueuewith aClientException.containerOrchestrationType: "ECS".Written for commit 6303981. Summary will update on new commits.