diff options
author | 2023-05-16 15:09:29 +0200 | |
---|---|---|
committer | 2023-05-16 15:09:29 +0200 | |
commit | c7702c47bb887a220233fd92d80a1084a25f2a27 (patch) | |
tree | f6b225f8dc4d51a4be807b7d45678e371d7c2bee | |
parent | [bugfix] Fix NegotiateFormat with multiple accept headers (#1797) (diff) | |
download | gotosocial-c7702c47bb887a220233fd92d80a1084a25f2a27.tar.xz |
[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.
-rw-r--r-- | internal/transport/finger_test.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/transport/finger_test.go b/internal/transport/finger_test.go index 21d3e1797..bd1e8b24d 100644 --- a/internal/transport/finger_test.go +++ b/internal/transport/finger_test.go @@ -87,9 +87,12 @@ func (suite *FingerTestSuite) TestFingerWithHostMetaCacheStrategy() { // the TTL of the entry should have extended because we did a second // 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) { - 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 |