-
Notifications
You must be signed in to change notification settings - Fork 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
Adding Integ Tests for Granular Stop Timeout #1887
Adding Integ Tests for Granular Stop Timeout #1887
Conversation
802aacc
to
5943480
Compare
agent/engine/ordering_integ_test.go
Outdated
|
||
stateChangeEvents := taskEngine.StateChangeEvents() | ||
|
||
taskArn := "testDependencyHealthyTimeout" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change name
agent/engine/ordering_integ_test.go
Outdated
taskArn := "testDependencyHealthyTimeout" | ||
testTask := createTestTask(taskArn) | ||
|
||
dependency := createTestContainerWithImageAndName(baseImageForOS, "dependency") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd do this test the other way around -- 1 parent, 2 dependencies. You can get rid of the sleep (and do exit 0 instead) since this will guarantee that the other containers have started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
agent/engine/ordering_integ_test.go
Outdated
|
||
verifyContainerStoppedStateChange(t, taskEngine) | ||
verifyContainerStoppedStateChange(t, taskEngine) | ||
verifyContainerStoppedStateChange(t, taskEngine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will succeed regardless of if the timeouts are applied or not. We need to validate the exit codes of the containers.
a0a5437
to
399f151
Compare
agent/engine/ordering_integ_test.go
Outdated
} | ||
|
||
dependency1.EntryPoint = &entryPointForOS | ||
dependency1.Command = []string{"trap 'echo caught' SIGTERM; while true; do echo hello; sleep 1s; done;"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this Command be the same as the other one? Just so we can be confident that the timeout is the only changing parameter?
This doesn't change the outcome of the test, it just more explicitly demonstrates what we have built
399f151
to
5a1f788
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but the test won't work on windows. move it to the linux-specific file.
agent/engine/ordering_integ_test.go
Outdated
@@ -339,6 +340,74 @@ func TestDependencyHealthyTimeout(t *testing.T) { | |||
waitFinished(t, finished, orderingTimeout) | |||
} | |||
|
|||
|
|||
func TestGranularStopTimeout(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uses functions that don't exist in powershell. I'd move this to the _integ_linux_test.go file
74911e6
to
464ff08
Compare
464ff08
to
e34ceb7
Compare
1fe1f73
to
bc3f30c
Compare
The default helper function will now allocate 1024 cpu shares or 100% cpu-percent on windows. This will enable the windows based tests to finish in more predictable ways. When Windows tests were constrained, simple tasks liek "sleep 10" were taking much longer than the expected 10 seconds.
#1869 - The windows functional test issues |
We've validated the linux tests manually. I believe we are getting errors in the windows functional tests because we set the pull behavior to 'prefer cached'. The error message we are receiving is that PullImageStart time is not set. |
I'll validate with haikuo if this is the expected behavior. If not, we will need to fix this bug. |
TraceLog Events
Summary
Implementation details
Testing
New tests cover the changes:
Description for the changelog
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.