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

ppker / tailscale / 9357177100
52%

Build:
DEFAULT BRANCH: main
Ran 03 Jun 2024 09:17PM UTC
Jobs 1
Files 646
Run time 1min
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

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>

19 of 24 new or added lines in 1 file covered. (79.17%)

47459 of 93002 relevant lines covered (51.03%)

0.57 hits per line

Jobs
ID Job ID Ran Files Coverage
1 9357177100.1 03 Jun 2024 09:17PM UTC 0
51.03
GitHub Action Run
Source Files on build 9357177100
Detailed source file information is not available for this build.
  • Back to Repo
  • 3bf2bddb on github
  • Next Build on main (#12999167389)
  • 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