#45 FB_SimplePayloadEncoder: all unit tests all return a 37KB payload, even the small ones

MVP basic protobufs
closed
aliazzz
None
2020-09-27
2020-08-17
i-campbell
No

It seems that all unit tests are returning the result of the biggest unit test.
==> SHOULD: Each returns a different payload.

Discussion

  • i-campbell

    i-campbell - 2020-08-17

    This is a unit test setup error.
    Every unit-test uses the same instance of FB_SparkPlugB_SimpleEncoder.
    They use a case statement to perform parts of the tests on different scans.
    so for example:
    1. Test_EncoderWithSimpleMetricBool will on the first scan Init the encoder and add metric
    2. Test_EncoderWithList will on the second scan Init the encoder and add metrics
    3. Then Test_EncoderWithSimpleMetricBool will on the second scan Encode

    From this, it can be seen that the encoding at 3 has nothing to do with the metrics added at 1 (because in the mean time, some other unit test has Init and added metrics.

    Possible solution:
    Every unit test has its own Encoder and own metrics. If we want to test "does it encode a second time?" then a specific and segregated test for that should be given.

     
  • i-campbell

    i-campbell - 2020-08-17
    • assigned_to: i-campbell --> aliazzz
     
  • aliazzz

    aliazzz - 2020-08-18

    moving the FB declaration(s) to the method itself in VAR_STAT

     
  • aliazzz

    aliazzz - 2020-08-18
    • status: accepted --> pending
     
  • aliazzz

    aliazzz - 2020-08-18

    Tests silo'ed with positive outcome.
    Stumbled upon a side effect (re-open corresponding ticket?).

    EncodeMetricsList_Test encounters a 'payloadnotenoughmetrics' error while adding a list of 1024 metrics.

     
  • i-campbell

    i-campbell - 2020-08-24

    solved with [r318].
    Further segregated the resources between unit tests.

     
  • i-campbell

    i-campbell - 2020-08-24
    • status: pending --> closed
     
  • aliazzz

    aliazzz - 2020-09-27

    Just some remarks:
    It seems a shared master metrics list in between tests is also an issue.
    To further compartmentalize the tests, we should declare separate Master Metrics Lists on a 'per test basis'.

    My personal thoughts are to suffice with a list of 1 instance per simpletype in masterlist (so its currently 15/16 metrics in size). Offcourse tests with more metrics should have a bigger list.

     

Log in to post a comment.