BACnet4J icon indicating copy to clipboard operation
BACnet4J copied to clipboard

Wip/mango 1945/fix failing tests

Open kishorevenki opened this issue 9 months ago • 3 comments

  • This fix addresses the issues mentioned in https://radixiot.atlassian.net/browse/MANGO-1945 .
  • Two tests from TrendLogObjectTest and one test from TrendLogObjectMultipleTest were failing.
  • The intent of these tests are to verify that data are collected at periodic interval as per Log-Interval property.
  • While TrendObjects are collecting the data for every minute, the test incorrectly change the log interval to one hour. Collection of records and hence the record-count cannot be accurate if the log interval property is changed while TrendLog objects are collecting the live data. Further such step is not the standard test requirement.
  • Tests are fixed by removing the steps of chage of Log-Interval property while collecting the data.

kishorevenki avatar Feb 10 '25 09:02 kishorevenki

I checked out the code and dug around a little. Instead of removing some of the coverage can we just move those 1hr test cases into separate tests? I get a little nervous when I see the failing code of a test just deleted. I think I understand why it is failing but since we are using a WarpClock there is probably a few ways to make this work without removing the code.

From what I can tell this is really the code you removed that you are concerned with:

        // Advance the clock to the new polling time.
        final int minutes = (62 - clock.get(ChronoField.MINUTE_OF_HOUR)) % 60;
        clock.plus(minutes, MINUTES, 0);

I'm thinking if you just set the time to a nice round number at the start of the test or account for why the above could be off by 1m2s ever.

However I would be ok with just having a separate tests for the 1hr polling interval.

terrypacker avatar Feb 11 '25 14:02 terrypacker

Adding a separate test for one hour polling interval would be better.

kishorevenki avatar Feb 11 '25 15:02 kishorevenki

@kishorevenki can you have a look at some of the changes made to these files recently (both in merged PRs and one that has yet to be) and confirm that the issue you are addressing has been fixed.

mlohbihler avatar Jun 26 '25 14:06 mlohbihler