EMR - Step state should be RUNNING, not STARTING (#4455)

This commit is contained in:
Bert Blommers 2021-10-21 16:37:57 +00:00 committed by GitHub
parent 0590ad296e
commit 64e16d970a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -356,7 +356,7 @@ class FakeCluster(BaseModel):
# If we already have other steps, this one is pending # If we already have other steps, this one is pending
fake = FakeStep(state="PENDING", **step) fake = FakeStep(state="PENDING", **step)
else: else:
fake = FakeStep(state="STARTING", **step) fake = FakeStep(state="RUNNING", **step)
self.steps.append(fake) self.steps.append(fake)
added_steps.append(fake) added_steps.append(fake)
self.state = "RUNNING" self.state = "RUNNING"

View File

@ -592,7 +592,7 @@ def test_steps():
step.name.should.be.a(str) step.name.should.be.a(str)
# step.readydatetime.should.be.a(str) # step.readydatetime.should.be.a(str)
# step.startdatetime.should.be.a(str) # step.startdatetime.should.be.a(str)
step.state.should.be.within(["STARTING", "PENDING"]) step.state.should.be.within(["RUNNING", "PENDING"])
expected = dict((s.name, s) for s in input_steps) expected = dict((s.name, s) for s in input_steps)
@ -617,7 +617,7 @@ def test_steps():
# properties # properties
x.should.have.property("id").should.be.a(str) x.should.have.property("id").should.be.a(str)
x.name.should.equal(y.name) x.name.should.equal(y.name)
x.status.state.should.be.within(["STARTING", "PENDING"]) x.status.state.should.be.within(["RUNNING", "PENDING"])
# x.status.statechangereason # x.status.statechangereason
x.status.timeline.creationdatetime.should.be.a(str) x.status.timeline.creationdatetime.should.be.a(str)
# x.status.timeline.enddatetime.should.be.a(str) # x.status.timeline.enddatetime.should.be.a(str)
@ -641,7 +641,7 @@ def test_steps():
# properties # properties
x.should.have.property("id").should.be.a(str) x.should.have.property("id").should.be.a(str)
x.name.should.equal(y.name) x.name.should.equal(y.name)
x.status.state.should.be.within(["STARTING", "PENDING"]) x.status.state.should.be.within(["RUNNING", "PENDING"])
# x.status.statechangereason # x.status.statechangereason
x.status.timeline.creationdatetime.should.be.a(str) x.status.timeline.creationdatetime.should.be.a(str)
# x.status.timeline.enddatetime.should.be.a(str) # x.status.timeline.enddatetime.should.be.a(str)
@ -653,7 +653,7 @@ def test_steps():
# step_states argument. # step_states argument.
steps = conn.list_steps(cluster_id).steps steps = conn.list_steps(cluster_id).steps
step_id = steps[0].id step_id = steps[0].id
steps = conn.list_steps(cluster_id, step_states=["STARTING"]).steps steps = conn.list_steps(cluster_id, step_states=["RUNNING"]).steps
steps.should.have.length_of(1) steps.should.have.length_of(1)
steps[0].id.should.equal(step_id) steps[0].id.should.equal(step_id)

View File

@ -991,7 +991,7 @@ def test_steps():
# x['ExecutionStatusDetail'].should.have.key('LastStateChangeReason') # x['ExecutionStatusDetail'].should.have.key('LastStateChangeReason')
# x['ExecutionStatusDetail'].should.have.key('StartDateTime') # x['ExecutionStatusDetail'].should.have.key('StartDateTime')
x["ExecutionStatusDetail"]["State"].should.equal( x["ExecutionStatusDetail"]["State"].should.equal(
"STARTING" if idx == 0 else "PENDING" "RUNNING" if idx == 0 else "PENDING"
) )
x["StepConfig"]["ActionOnFailure"].should.equal("TERMINATE_CLUSTER") x["StepConfig"]["ActionOnFailure"].should.equal("TERMINATE_CLUSTER")
x["StepConfig"]["HadoopJarStep"]["Args"].should.equal( x["StepConfig"]["HadoopJarStep"]["Args"].should.equal(
@ -1021,7 +1021,7 @@ def test_steps():
# Properties # Properties
x["Id"].should.be.a(str) x["Id"].should.be.a(str)
x["Name"].should.equal(y["Name"]) x["Name"].should.equal(y["Name"])
x["Status"]["State"].should.be.within(["STARTING", "PENDING"]) x["Status"]["State"].should.be.within(["RUNNING", "PENDING"])
# StateChangeReason # StateChangeReason
x["Status"]["Timeline"]["CreationDateTime"].should.be.a("datetime.datetime") x["Status"]["Timeline"]["CreationDateTime"].should.be.a("datetime.datetime")
# x['Status']['Timeline']['EndDateTime'].should.be.a('datetime.datetime') # x['Status']['Timeline']['EndDateTime'].should.be.a('datetime.datetime')
@ -1037,7 +1037,7 @@ def test_steps():
# Properties # Properties
x["Id"].should.be.a(str) x["Id"].should.be.a(str)
x["Name"].should.equal(y["Name"]) x["Name"].should.equal(y["Name"])
x["Status"]["State"].should.be.within(["STARTING", "PENDING"]) x["Status"]["State"].should.be.within(["RUNNING", "PENDING"])
# StateChangeReason # StateChangeReason
x["Status"]["Timeline"]["CreationDateTime"].should.be.a("datetime.datetime") x["Status"]["Timeline"]["CreationDateTime"].should.be.a("datetime.datetime")
# x['Status']['Timeline']['EndDateTime'].should.be.a('datetime.datetime') # x['Status']['Timeline']['EndDateTime'].should.be.a('datetime.datetime')
@ -1048,7 +1048,7 @@ def test_steps():
steps.should.have.length_of(1) steps.should.have.length_of(1)
steps[0]["Id"].should.equal(step_id) steps[0]["Id"].should.equal(step_id)
steps = client.list_steps(ClusterId=cluster_id, StepStates=["STARTING"])["Steps"] steps = client.list_steps(ClusterId=cluster_id, StepStates=["RUNNING"])["Steps"]
steps.should.have.length_of(1) steps.should.have.length_of(1)
steps[0]["Id"].should.equal(step_id) steps[0]["Id"].should.equal(step_id)