Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-neigh: Fix unit test flake #16072

Merged
merged 3 commits into from
May 12, 2021
Merged

node-neigh: Fix unit test flake #16072

merged 3 commits into from
May 12, 2021

Commits on May 10, 2021

  1. node-neigh: Set lastPing if arping was successful

    We don't return early if arping was skipped. This can happen when
    insertNeighbor() is invoked by the non-refresh path and nexthop is not
    new.
    
    Make sure that lastPing is updated only if arping was sent and it was
    successful (if hwAddr != nil condition).
    
    Signed-off-by: Martynas Pumputis <m@lambda.lt>
    brb committed May 10, 2021
    Configuration menu
    Copy the full SHA
    b22f276 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2021

  1. node-neigh: Wait instead of sleeping in unit tests

    We can inspect the neighLastPingByNextHop map to check when
    insertNeighbor() or deleteNeighbor() was called.
    
    Signed-off-by: Martynas Pumputis <m@lambda.lt>
    brb committed May 11, 2021
    Configuration menu
    Copy the full SHA
    984ae0e View commit details
    Browse the repository at this point in the history
  2. node-neigh: Skip neigh update if arping is stale

    It's possible that in the case of multiple concurrent insertNeighbor()
    executions the oldest (or older) goroutine will overwrite the latest
    arping result due to the fine-grained locking.
    
    To fix this, avoid updating neigh entry if we detect that prev last ping
    timestamp is after our arping timestamp.
    
    Signed-off-by: Martynas Pumputis <m@lambda.lt>
    brb committed May 11, 2021
    Configuration menu
    Copy the full SHA
    4de58ba View commit details
    Browse the repository at this point in the history