Project

General

Profile

Actions

Task #3830

open

Make ASF strategy tests predictable

Added by Ashlesh Gawande over 7 years ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Unit Tests
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

https://gerrit.named-data.net/3255 breaks the tests at line:
https://github.com/named-data/NFD/blob/8a4c29e8db5e6fd588b2d797f8f90110dc1083a8/tests/daemon/fw/asf-strategy.t.cpp#L161
(61 > 60) on some machines.

We should be able to predict the outcome better.

Actions #1

Updated by Junxiao Shi over 7 years ago

  • Description updated (diff)

Changed GitHub link to point to exact commit hash, so that it stays relevant even if the master branch changes in the future.

Actions #2

Updated by Junxiao Shi over 7 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:

batch A-B A-D
0 >=24 <=6
1 <=30 >=30
2 >=50 <=40
3 <=60 >=60

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:

batch A-B A-D
0 >=24 <=6
1 <=6 >=24
2 >=20 <=10
3 <=10 >=20
Actions #3

Updated by Ashlesh Gawande over 7 years ago

  • Description updated (diff)
Actions #4

Updated by Junxiao Shi almost 7 years ago

  • Category set to Forwarding
Actions #5

Updated by Ashlesh Gawande about 6 years ago

  • Assignee set to Saurab Dulal
Actions #6

Updated by Davide Pesavento over 5 years ago

  • Tags set to UnitTests
  • Start date deleted (10/27/2016)
Actions #7

Updated by Davide Pesavento 10 months ago

  • Tags changed from unit-tests to unit-tests, ASF
Actions #8

Updated by Davide Pesavento about 2 months ago

  • Category changed from Forwarding to Unit Tests
  • Assignee deleted (Saurab Dulal)
Actions

Also available in: Atom PDF