mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-22 11:46:40 +00:00
[chore] Change time comparison in webfinger test (#1798)
Every now and then the TestFingerWithHostMetaCacheStrategy would fail on a time related error. I suspect suite.Equal doesn't quite work as expected when given two time.Time's, so instead explicitly check with the time.Equal.
This commit is contained in:
parent
e91cabb704
commit
c7702c47bb
|
@ -87,9 +87,12 @@ func (suite *FingerTestSuite) TestFingerWithHostMetaCacheStrategy() {
|
||||||
|
|
||||||
// the TTL of the entry should have extended because we did a second
|
// the TTL of the entry should have extended because we did a second
|
||||||
// successful finger
|
// successful finger
|
||||||
suite.NotEqual(initialTime, repeatTime, "expected webfinger cache entry to have different expiry times")
|
if repeatTime.Equal(initialTime) {
|
||||||
|
suite.FailNowf("expected webfinger cache entry to have different expiry times", "initial: '%s', repeat: '%s'", initialTime, repeatTime)
|
||||||
|
}
|
||||||
|
|
||||||
if repeatTime.Before(initialTime) {
|
if repeatTime.Before(initialTime) {
|
||||||
suite.FailNow("expected webfinger cache entry to not be a time traveller")
|
suite.FailNowf("expected webfinger cache entry to not be a time traveller", "initial: '%s', repeat: '%s'", initialTime, repeatTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
// finger a non-existing user on that same instance which will return an error
|
// finger a non-existing user on that same instance which will return an error
|
||||||
|
|
Loading…
Reference in a new issue