fix(emr-serverless): retain deleted applications for waiters (#6103)

* fix(emr-serverless): retain deleted applications for waiters

* fix(emr-serverless): reject tag access after application deletion
This commit is contained in:
Jimmy Liu Jia authored and GitHub committed 2026-10-20 23:48:12 -04:00
1 parent e5591dda32
commit 03f87285a0
4 files changed
+70 -3

No files matched your search

@@ -253,11 +253,37 @@ public class EmrServerlessIntegrationTest {
.then()
.statusCode(200);
// Verify it's gone
givenReq()
.when()
.get("/applications/" + applicationId)
.then()
.statusCode(404);
.statusCode(200)
.body("application.state", equalTo("TERMINATED"));
givenReq()
.when()
.get("/applications")
.then()
.statusCode(200)
.body("applications.find { it.id == '" + applicationId + "' }", nullValue());
givenReq()
.when()
.post("/applications/" + applicationId + "/start")
.then()
.statusCode(400);
givenReq()
.when()
.post("/applications/" + applicationId + "/stop")
.then()
.statusCode(400);
givenReq()
.when()
.get("/applications/" + applicationId)
.then()
.statusCode(200)
.body("application.state", equalTo("TERMINATED"));
}
}
@@ -96,6 +96,32 @@ class EmrServerlessTagIntegrationTest {
.body("tags.team", equalTo("platform"));
}
@Test
void terminatedApplicationsCannotBeTagged() {
String[] app = createApplication("{ \"team\": \"data\" }");
String path = tagsPath(app[1]);
emr().when().delete("/applications/" + app[0])
.then().statusCode(200);
emr().when().get(path)
.then().statusCode(404)
.body("__type", equalTo("ResourceNotFoundException"));
emr().body("{ \"tags\": { \"env\": \"dev\" } }")
.when().post(path)
.then().statusCode(404)
.body("__type", equalTo("ResourceNotFoundException"));
emr().when().delete(path + "?tagKeys=team")
.then().statusCode(404)
.body("__type", equalTo("ResourceNotFoundException"));
emr().when().get("/applications/" + app[0])
.then().statusCode(200)
.body("application.state", equalTo("TERMINATED"))
.body("application.tags.team", equalTo("data"))
.body("application.tags", not(hasKey("env")));
}
@Test
void unknownApplicationsAndJobRunsAreNotFoundAndBadTagsAreRefused() {
String arn = createApplication("{}")[1];