Tests in CI failing when doing approx time comparisions for cache timing.
=== RUN TestGetUserList
user_cache_test.go:237:
Error Trace: user_cache_test.go:237
Error: Not equal:
expected: []main.userList{main.userList{Username:"test1", SlackUserID:"1", SlackStatus:"", CacheExpire:time.Date(2022, time.August, 3, 21, 20, 41, 0, time.Local), Expired:false}, main.userList{Username:"test2", SlackUserID:"2", SlackStatus:"", CacheExpire:time.Date(2021, time.August, 3, 13, 20, 41, 0, time.Local), Expired:true}}
actual : []main.userList{main.userList{Username:"test2", SlackUserID:"2", SlackStatus:"", CacheExpire:time.Date(2021, time.August, 3, 13, 20, 41, 0, time.Local), Expired:true}, main.userList{Username:"test1", SlackUserID:"1", SlackStatus:"", CacheExpire:time.Date(2022, time.August, 3, 21, 20, 41, 0, time.Local), Expired:false}}
Diff:
--- Expected
+++ Actual
@@ -1,2 +1,38 @@
([]main.userList) (len=2) {
+ (main.userList) {
+ Username: (string) (len=5) "test2",
+ SlackUserID: (string) (len=1) "2",
+ SlackStatus: (string) "",
+ CacheExpire: (time.Time) {
+ wall: (uint64) 0,
+ ext: (int64) [63](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:64)763593[64](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:65)1,
+ loc: (*time.Location)({
+ name: (string) (len=5) "Local",
+ zone: ([]time.zone) (len=1) {
+ (time.zone) {
+ name: (string) (len=3) "UTC",
+ offset: (int) 0,
+ isDST: (bool) false
+ }
+ },
+ tx: ([]time.zoneTrans) (len=1) {
+ (time.zoneTrans) {
+ when: (int64) -922337203[68](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:69)54775808,
+ index: (uint8) 0,
+ isstd: (bool) false,
+ isutc: (bool) false
+ }
+ },
+ extend: (string) (len=4) "UTC0",
+ cacheStart: (int64) 92233[72](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:73)0368547[75](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:76)807,
+ cacheEnd: (int64) 9223372036854775807,
+ cacheZone: (*time.zone)({
+ name: (string) (len=3) "UTC",
+ offset: (int) 0,
+ isDST: (bool) false
+ })
+ })
+ },
+ Expired: (bool) true
+ },
(main.userList) {
@@ -36,38 +72,2 @@
Expired: (bool) false
- },
- (main.userList) {
- Username: (string) (len=5) "test2",
- SlackUserID: (string) (len=1) "2",
- SlackStatus: (string) "",
- CacheExpire: (time.Time) {
- wall: (uint64) 0,
- ext: (int64) 63[76](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:77)3593641,
- loc: (*time.Location)({
- name: (string) (len=5) "Local",
- zone: ([]time.zone) (len=1) {
- (time.zone) {
- name: (string) (len=3) "UTC",
- offset: (int) 0,
- isDST: (bool) false
- }
- },
- tx: ([]time.zoneTrans) (len=1) {
- (time.zoneTrans) {
- when: (int64) -9223372036854[77](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:78)5[80](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:81)8,
- index: (uint8) 0,
- isstd: (bool) false,
- isutc: (bool) false
- }
- },
- extend: (string) (len=4) "UTC0",
- cacheStart: (int64) 9223372036[85](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:86)4775807,
- cacheEnd: (int64) [92](https://github.com/graemedavidson/gitlab-mr-bot/runs/7652796798?check_suite_focus=true#step:4:93)23372036854775807,
- cacheZone: (*time.zone)({
- name: (string) (len=3) "UTC",
- offset: (int) 0,
- isDST: (bool) false
- })
- })
- },
- Expired: (bool) true
}
Test: TestGetUserList
--- FAIL: TestGetUserList (0.00s)
Tests in CI failing when doing approx time comparisions for cache timing.
CI Run