Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-4272

DurationTest.Arithmetic performs inexact float calculation in test

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • test
    • None
    • Mesosphere Sprint 26
    • 1

    Description

      DurationTest.Arithmetic does a calculation with not exactly representable floating point values and also performs an equality check,

      EXPECT_EQ(Duration::create(3.3).get(), Seconds(10) * 0.33);
      

      Here neither the value 3.3 nor 0.33 cannot be represented exactly as a floating point number so the check might fail incorrectly (as it does e.g. when compiling and executing the test under 32-bit on Debian8).

      Instead we should just use exactly representable values to make sure the test will succeed as long as the implementation behaves as expected.

      Attachments

        Activity

          People

            bbannier Benjamin Bannier
            bbannier Benjamin Bannier
            Till Toenshoff Till Toenshoff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: