mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-09 22:33:11 +02:00
fileutil: reimplement file watcher (#5498)
* remove context, add close * update tests * cleanup * fileutil: reimplement file watcher * remove test, simplify tree set code, fix data race
This commit is contained in:
parent
1b2618170d
commit
1f30dead31
6 changed files with 332 additions and 103 deletions
|
@ -190,23 +190,6 @@ runtime_flags:
|
|||
}
|
||||
|
||||
require.Empty(t, ch, "expected exactly one OnConfigChange event")
|
||||
|
||||
// the file watcher checks modification time, not contents
|
||||
err = os.Chtimes(configFilePath, time.Now(), time.Now())
|
||||
require.NoError(t, err)
|
||||
|
||||
select {
|
||||
case <-ch:
|
||||
if !enabled {
|
||||
t.Error("expected OnConfigChange not to be fired after triggering a change to the underlying source")
|
||||
}
|
||||
case <-time.After(time.Second):
|
||||
if enabled {
|
||||
t.Error("expected OnConfigChange to be fired after triggering a change to the underlying source")
|
||||
}
|
||||
}
|
||||
|
||||
require.Empty(t, ch, "expected exactly one OnConfigChange event")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue