Make ASF strategy tests predictable
https://gerrit.named-data.net/3255 breaks the tests at line:
(61 > 60) on some machines.
We should be able to predict the outcome better.
Updated by Junxiao Shi almost 4 years ago
I've read the test case.
In its current logic, the same
AsfStrategy instance is used to make decisions for four batches of 30 Interests from a consumer, and the Interest counters on A-B and A-D links are asserted as follows:
These assertions are badly designed, because every assertion tests the accumulative packet counter since the beginning, while the behavior in each batch is independent from the counter value before processing this batch.
For example, batch2 A-B assertion will pass when A-B counter is either 50 or 58, but the former allows batch3 to increment this counter by up to 10 while the latter only permits an increment of no more than 2.
My suggestion is to reset the counters to zero before processing each batch, and change the assertions as follows: