GothenburgBitFactory / GothenburgBitFactory/libshared

Tests fail in some timezones

Open
#41 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
7
Forks
30
Avg merge
13h 17m
Merged PRs (30d)
1

Description

```
$ date
Wed Jul 7 22:18:59 2021

# ^^^ summer time

$ TZ="Europe/Dublin" ./run_all
Passed: 8283
Failed: 54
Unexpected successes: 0
Skipped: 1
Expected failures: 0
Runtime: 0.30 seconds
```

Seems like some actual values about an hour off:

```
$ make test
<...>
ok 3152 - eoq > now
actual (first - relative:true): 20210731T230000Z now: 20210707T211751Z
ok 3153 - 1st not in same month as now
ok 3154 - 1st day is 1
actual (second - relative:true): 20210801T230000Z now: 20210707T211751Z
ok 3155 - 2nd not in same month as now
ok 3156 - 2nd day is 2
actual (third - relative:true): 20210802T230000Z now: 20210707T211751Z
ok 3157 - 3rd not in same month as now
ok 3158 - 3rd day is 3
actual (fourth - relative:true): 20210803T230000Z now: 20210707T211751Z
ok 3159 - 4th not in same month as now
ok 3160 - 4th day is 4
actual (first - relative:false): 20210630T230000Z now: 20210707T211751Z
ok 3161 - 1st in same month as now
ok 3162 - 1st day is 1
actual (second - relative:false): 20210701T230000Z now: 20210707T211751Z
ok 3163 - 2nd in same month as now
ok 3164 - 2nd day is 2
actual (third - relative:false): 20210702T230000Z now: 20210707T211751Z
ok 3165 - 3rd in same month as now
ok 3166 - 3rd day is 3
actual (fourth - relative:false): 20210703T230000Z now: 20210707T211751Z
ok 3167 - 4th in same month as now
<...>
```

However:

```
$ TZ="UTC" ./run_all
Passed: 8337
Failed: 0
Unexpected successes: 0
Skipped: 1
Expected failures: 0
Runtime: 0.30 seconds
```

```
$ TZ="America/Los_Angeles" ./run_all
Passed: 8337
Failed: 0
Unexpected successes: 0
Skipped: 1
Expected failures: 0
Runtime: 0.30 seconds
```

I didn't dig any further.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.