-: fix qlog test on Windows

This commit is contained in:
Andrey Meshkov 2020-04-15 14:11:31 +03:00
parent b9b42997af
commit e96fd6e42d
2 changed files with 4 additions and 2 deletions

View File

@ -112,9 +112,9 @@ func TestHome(t *testing.T) {
dir := prepareTestDir()
defer func() { _ = os.RemoveAll(dir) }()
_ = os.MkdirAll(filepath.Join(Context.getDataDir(), filterDir), 0755)
fn := filepath.Join(dir, "AdGuardHome.yaml")
// Prepare the test config
assert.True(t, ioutil.WriteFile(fn, []byte(yamlConf), 0644) == nil)
fn, _ = filepath.Abs(fn)

View File

@ -206,7 +206,9 @@ func (l *queryLog) getData(params getDataParams) map[string]interface{} {
fileEntries, oldest, total := l.searchFiles(params)
if params.OlderThan.IsZero() {
params.OlderThan = now
// In case if the timer is not precise (for instance, on Windows)
// We really want to get all records including those added just before the call
params.OlderThan = now.Add(time.Millisecond)
}
// add from memory buffer