Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.0
    • Component/s: CDAP Examples
    • Labels:
      None
    • Release Notes:
      Fixed a bug in the Purchase example that could cause purchases to overwrite each other.
    • Rank:
      1|i0029b:

      Description

      The PurchaseAppTest is occasionally failing for me with:

      test(co.cask.cdap.examples.purchase.PurchaseAppTest)  Time elapsed: 14.336 sec  <<< FAILURE!
      java.lang.AssertionError: expected:<2> but was:<1>
      	at org.junit.Assert.fail(Assert.java:88)
      	at org.junit.Assert.failNotEquals(Assert.java:743)
      	at org.junit.Assert.assertEquals(Assert.java:118)
      	at org.junit.Assert.assertEquals(Assert.java:555)
      	at org.junit.Assert.assertEquals(Assert.java:542)
      	at co.cask.cdap.examples.purchase.PurchaseAppTest.test(PurchaseAppTest.java:132)
      

      The reason is that we are using System.currentTimeMillis() as the key to write each purchase. So purchases by the same user can clobber each other.

      This app has remained the same for years, so I don't know why this is just popping up now. I suppose it's possible things got faster so we're only seeing it now.

        Attachments

          Activity

            People

            • Assignee:
              ashau Albert Shau
              Reporter:
              ashau Albert Shau
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: