mirror of
https://github.com/openshift/source-to-image.git
synced 2026-02-05 12:44:54 +01:00
Add regression test for incremental builds
Ensure the build takes no more than DefaultDockerTimeout, what would suggest that S2I got stuck waiting for the timeout.
This commit is contained in:
@@ -438,6 +438,7 @@ func (i *integrationTest) exerciseInjectionBuild(tag, imageName string, injectio
|
||||
|
||||
func (i *integrationTest) exerciseIncrementalBuild(tag, imageName string, removePreviousImage bool, expectClean bool, checkOnBuild bool) {
|
||||
t := i.t
|
||||
start := time.Now()
|
||||
config := &api.Config{
|
||||
DockerConfig: docker.GetDefaultDockerConfig(),
|
||||
BuilderImage: imageName,
|
||||
@@ -505,6 +506,13 @@ func (i *integrationTest) exerciseIncrementalBuild(tag, imageName string, remove
|
||||
if checkOnBuild {
|
||||
i.fileExists(containerID, "/sti-fake/src/onbuild")
|
||||
}
|
||||
|
||||
if took := time.Since(start); took > docker.DefaultDockerTimeout {
|
||||
// https://github.com/openshift/source-to-image/issues/301 is a
|
||||
// case where incremental builds would get stuck until the
|
||||
// timeout.
|
||||
t.Errorf("Test took too long (%v), some operation may have gotten stuck waiting for the DefaultDockerTimeout (%v). Inspect the logs to find operations that took long.", took, docker.DefaultDockerTimeout)
|
||||
}
|
||||
}
|
||||
|
||||
// Support methods
|
||||
|
||||
@@ -3,3 +3,7 @@ touch /tmp/src/save-artifacts-invoked
|
||||
|
||||
cd /tmp/src
|
||||
tar cf - .
|
||||
|
||||
# Write some zeros to stdout to mimic the padding that Debian's tar adds
|
||||
# https://github.com/openshift/source-to-image/issues/301#issuecomment-263598586
|
||||
dd count=1 if=/dev/zero 2> /dev/null
|
||||
|
||||
Reference in New Issue
Block a user