Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-34938

Old resources in test environment lead to race condition

XMLWordPrintable

    • No
    • CLOUD Sprint 254, CLOUD Sprint 255
    • 2
    • False
    • Hide

      None

      Show
      None
    • N/A
    • Release Note Not Required
    • Done

      Description of problem:

      sometimes the unit test is failing in CI, it appears to be related to how the tests are structured in combination with the random ordering.
          

      Version-Release number of selected component (if applicable):

      
          

      How reproducible:

      intermittent, there appears to be a condition that when the tests are executed in random order it is possible for some of them to fail due to old objects being in the test suite.
          

      Steps to Reproduce:

          1. run `make test`
          2.
          3.
          

      Actual results:

      sometimes, this will be in the build output
          
      === RUN   TestApplyConfigMap/skip_on_extra_label
          resourceapply_test.go:177: 
              Expected success, but got an error:
                  <*errors.StatusError | 0xc0002dc140>: 
                  configmaps "foo" already exists
                  {
                      ErrStatus: {
                          TypeMeta: {Kind: "", APIVersion: ""},
                          ListMeta: {
                              SelfLink: "",
                              ResourceVersion: "",
                              Continue: "",
                              RemainingItemCount: nil,
                          },
                          Status: "Failure",
                          Message: "configmaps \"foo\" already exists",
                          Reason: "AlreadyExists",
                          Details: {Name: "foo", Group: "", Kind: "configmaps", UID: "", Causes: nil, RetryAfterSeconds: 0},
                          Code: 409,
                      },
                  }
      

      Expected results:

      tests pass
          

      Additional info:

      it looks like we are also missing the proper test env remote bucket flag on the make command. it should have something like:
      
      "--remote-bucket openshift-kubebuilder-tools"
          

            mimccune@redhat.com Michael McCune
            mimccune@redhat.com Michael McCune
            Zhaohua Sun Zhaohua Sun
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: