• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ppker / tailscale / 9357177100 / 1
52%
main: 52%

Build:
DEFAULT BRANCH: main
Ran 03 Jun 2024 09:17PM UTC
Files 646
Run time 24s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Jun 2024 08:58PM UTC coverage: 51.03%. First build
9357177100.1

push

github

sailorfrag
ipn/ipnlocal: improve testability of random node selection

In order to test the sticky last suggestion code, a test was written for
LocalBackend.SuggestExitNode but it contains a random number generator
which makes writing comprehensive tests very difficult. This doesn't
change how the last suggestion works, but it adds some infrastructure to
make that easier in a later PR.

This adds func parameters for the two randomized parts: breaking ties
between DERP regions and breaking ties between nodes. This way tests can
validate the entire list of tied options, rather than expecting a
particular outcome given a particular random seed.

As a result of this, the global random number generator can be used
rather than seeding a local one each time.

In order to see the tied nodes for the location based (i.e. Mullvad)
case, pickWeighted needed to return a slice instead of a single
arbitrary option, so there is a small change in how that works.

Updates tailscale/corp#19681

Change-Id: I83c48a752
Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>

47459 of 93002 relevant lines covered (51.03%)

0.57 hits per line

Source Files on job 9357177100.1
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 9357177100
  • 3bf2bddb on github
  • Next Job for on main (#12999167389.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc