Skip to content

Commit

Permalink
Fix flake in the extended tests
Browse files Browse the repository at this point in the history
Signed-off-by: Gladkov Alexey <agladkov@redhat.com>
  • Loading branch information
legionus committed Oct 9, 2017
1 parent 09c822e commit e2523a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/extended/images/hardprune.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
testutil "github.com/openshift/origin/test/util"
)

var _ = g.Describe("[Feature:ImagePrune] Image hard prune", func() {
var _ = g.Describe("[Feature:ImagePrune][Serial] Image hard prune", func() {
defer g.GinkgoRecover()
var oc = exutil.NewCLI("prune-images", exutil.KubeConfigPath())
var originalAcceptSchema2 *bool
Expand Down
9 changes: 9 additions & 0 deletions test/extended/images/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,15 @@ func (c *CleanUpContainer) Run() {
}
}

// Remove registry database between tests to avoid the influence of one test on another.
// TODO: replace this with removals of individual blobs used in the test case.
out, err := c.OC.SetNamespace(metav1.NamespaceDefault).AsAdmin().
Run("rsh").Args("dc/docker-registry", "find", "/registry", "-mindepth", "1", "-delete").Output()
if err != nil {
fmt.Fprintf(g.GinkgoWriter, "clean up registry failed: %v\n", err)
fmt.Fprintf(g.GinkgoWriter, "%s\n", out)
}

if len(c.imageIDs) == 0 {
return
}
Expand Down
2 changes: 1 addition & 1 deletion test/extended/images/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
externalImageReference = "docker.io/openshift/origin-release:golang-1.4"
)

var _ = g.Describe("[Feature:ImagePrune] Image prune", func() {
var _ = g.Describe("[Feature:ImagePrune][Serial] Image prune", func() {
defer g.GinkgoRecover()
var oc = exutil.NewCLI("prune-images", exutil.KubeConfigPath())

Expand Down

0 comments on commit e2523a6

Please sign in to comment.