Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-7534

Random failure of afw testBox.py

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Story Points:
      0.1
    • Team:
      Architecture

      Description

      About one time in ten testBox.py fails:

      $ python tests/testBox.py 
      .E................
      ======================================================================
      ERROR: testConstruction (__main__.Box2DTestCase)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "tests/testBox.py", line 292, in testConstruction
          self.assertFloatsAlmostEqual(box.getDimensions(), geom.Extent2D(abs(dim.getX()), abs(dim.getY())))
        File "/Users/timj/work/lsstsw3/stack/DarwinX86/utils/12.0-10-g3b62a7d+1/python/lsst/utils/tests.py", line 636, in assertFloatsAlmostEqual
          for a, b, diff, rel in zip(lhs[bad], rhs[bad], absDiff[bad], relTo[bad]):
        File "/Users/timj/work/lsstsw3/build/afw/python/lsst/afw/geom/geomLib.py", line 2113, in __getitem__
          if k < 0 or k >= 2: raise IndexError(k)
      ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
       
      ----------------------------------------------------------------------
      Ran 18 tests in 0.038s
       
      FAILED (errors=1)
      

      Turns out that the random seed setting was moved from module level to class level but only one of the classes was fixed.

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            Please take a quick look.

            Show
            tjenness Tim Jenness added a comment - Please take a quick look.
            Hide
            Parejkoj John Parejko added a comment -

            Looks good. We should probably revisit how testConstruction works at some point: constructing 10 "random" bboxes isn't really exercising the various possible cases well.

            Show
            Parejkoj John Parejko added a comment - Looks good. We should probably revisit how testConstruction works at some point: constructing 10 "random" bboxes isn't really exercising the various possible cases well.
            Hide
            tjenness Tim Jenness added a comment -

            Merged.

            Show
            tjenness Tim Jenness added a comment - Merged.

              People

              Assignee:
              tjenness Tim Jenness
              Reporter:
              tjenness Tim Jenness
              Reviewers:
              John Parejko
              Watchers:
              John Parejko, Joshua Meyers, Russell Owen, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.