4 Commits

Author SHA1 Message Date
Brad Fitzpatrick
1cb855fb36 util/expvarx: deflake TestSafeFuncHappyPath with synctest
I probably could've deflaked this without synctest, but might as well use
it now that Go 1.25 has it.

Fixes #15348

Change-Id: I81c9253fcb7eada079f3e943ab5f1e29ba8e8e31
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-08 09:03:17 -07:00
Alex Chan
14adf5b717
utils/expvarx, tstest/integration: mark two tests as known flaky (#17052)
* utils/expvarx: mark TestSafeFuncHappyPath as known flaky

Updates #15348

Signed-off-by: Alex Chan <alexc@tailscale.com>

* tstest/integration: mark TestCollectPanic as known flaky

Updates #15865

Signed-off-by: Alex Chan <alexc@tailscale.com>

---------

Signed-off-by: Alex Chan <alexc@tailscale.com>
2025-09-08 15:27:24 +01:00
Brad Fitzpatrick
7c1d6e35a5 all: use Go 1.22 range-over-int
Updates #11058

Change-Id: I35e7ef9b90e83cac04ca93fd964ad00ed5b48430
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-04-16 15:32:38 -07:00
James Tucker
0f3b2e7b86 util/expvarx: add a time and concurrency limiting expvar.Func wrapper
expvarx.SafeFunc wraps an expvar.Func with a time limit. On reaching the
time limit, calls to Value return nil, and no new concurrent calls to
the underlying expvar.Func will be started until the call completes.

Updates tailscale/corp#16999
Signed-off-by: James Tucker <james@tailscale.com>
2024-01-24 17:47:16 -08:00