@@ -23,6 +23,7 @@ import (
2323 "os"
2424 "path/filepath"
2525 "reflect"
26+ "runtime"
2627 "testing"
2728 "time"
2829)
@@ -89,6 +90,9 @@ func TestCertificate2_AutoReload(t *testing.T) {
8990}
9091
9192func TestCertificate2_AutoReloadSymlink (t * testing.T ) {
93+ if runtime .GOOS == "windows" {
94+ t .Skip ("symlinks require admin on Windows" )
95+ }
9296 testCertificate2AutoReload (t , true )
9397}
9498
@@ -177,6 +181,9 @@ func TestCertificate2_AutoReloadCertFileOnly(t *testing.T) {
177181}
178182
179183func TestCertificate2_AutoReloadCertFileOnlySymlink (t * testing.T ) {
184+ if runtime .GOOS == "windows" {
185+ t .Skip ("symlinks require admin on Windows" )
186+ }
180187 testCertificate2AutoReloadCertFileOnly (t , true )
181188}
182189
@@ -216,6 +223,9 @@ func TestCertificate2_InvalidReloadIgnored(t *testing.T) {
216223}
217224
218225func TestCertificate2_InvalidReloadIgnoredSymlink (t * testing.T ) {
226+ if runtime .GOOS == "windows" {
227+ t .Skip ("symlinks require admin on Windows" )
228+ }
219229 testCertificate2InvalidReloadIgnored (t , true )
220230}
221231
@@ -286,8 +296,8 @@ func overwriteFile(t *testing.T, src, dst string, symlink bool) {
286296func updateCertWithWait (t * testing.T , cert * Certificate2 , symlink bool , update func ()) {
287297 done := make (chan struct {})
288298 wait := time .Second
289- if symlink {
290- wait = wait + symlinkReloadInterval // can take up to symlinkReloadInterval to detect changes
299+ if symlink || runtime . GOOS == "windows" {
300+ wait = wait + symlinkReloadInterval
291301 }
292302 ctx , cancel := context .WithTimeout (context .Background (), wait )
293303 defer cancel ()
0 commit comments