Open RealKindOne opened 3 months ago
Previously, millitime()
used gettimeofday
to get the current time. With the above update, it is switched to std::chrono::steady_clock::now()
. That one uses the monotonic clock and doesn't produce sensible values when interpreted as a wall clock timestamp.
Here is a test for when it gets fixed.
$ test/integration/inttest --gtest_filter=ZNCTest.ListsocketsModule
// https://github.com/znc/znc/issues/1910
TEST_F(ZNCTest, ListsocketsModule) {
auto znc = Run();
auto ircd = ConnectIRCd();
auto client = LoginClient();
client.Write("znc loadmod listsockets");
client.ReadUntil("Loaded module");
client.Write("PRIVMSG *listsockets :list");
// Look for year 20xx, not 1970.
client.ReadUntil("| _LISTENER | 20");
}
This test will break in year 2100 though :(
Add a TODO and deal with it later.
// TODO: Fix before Year 2100 - https://xkcd.com/1782/
// https://github.com/znc/znc/issues/1910
TEST_F(ZNCTest, ListsocketsModule) {
...
Juest
reported the bug in#znc
.I did a git bisect and finally found the offending commit after a few hours:
42fdf9b49f374849d4177f6e185e70a6541f7d31