Anonymous: Add 1min leeway in device count + search in tests for MySQL 5.7 (#101608)

This commit is contained in:
Matheus Macabu
2025-03-05 12:32:37 +01:00
committed by GitHub
parent b5be6cd4d6
commit 2638de6aeb
+5 -4
View File
@@ -126,9 +126,9 @@ func TestIntegrationDeviceService_tag(t *testing.T) {
{
httpReq: &http.Request{
Header: http.Header{
"User-Agent": []string{"test"},
"X-Forwarded-For": []string{"10.30.30.1"},
http.CanonicalHeaderKey(deviceIDHeader): []string{"32mdo31deeqwes"},
"User-Agent": []string{"testdisabled"},
"X-Forwarded-For": []string{"10.33.33.3"},
http.CanonicalHeaderKey(deviceIDHeader): []string{"t35td154b13d1d"},
},
},
kind: anonymous.AnonDeviceUI,
@@ -178,7 +178,8 @@ func TestIntegrationDeviceService_tag(t *testing.T) {
assert.Equal(t, tc.expectedDevice, devices[0])
}
to := time.Now()
// One minute is added to the end time as mysql 5.7 datetime type has a default precision of seconds and not milis.
to := time.Now().Add(time.Minute)
from := to.AddDate(0, 0, -1)
devicesCount, err := anonService.CountDevices(ctx, from, to)