There were two different race conditions between logic in TestTelegramConfirmedRequest
and TelegramAPIMock.GetUpdatesFunc and TelegramAPIMock.SendFunc:
GetUpdatesFunc may start before token was fetched,
then it produces empty telegramUpdate response, which causes assertions in SendFunc to fail.
When token becomes used and removed from wait queue after successful login completion,
then GetUpdatesFunc may be still called and new telegram update is created for same token.
This breaks telegram update processing logic,
and SendFunc gets called with the error parameter, which also breaks assertions.
There were two different race conditions between logic in
TestTelegramConfirmedRequest
andTelegramAPIMock.GetUpdatesFunc
andTelegramAPIMock.SendFunc
:GetUpdatesFunc
may start before token was fetched, then it produces emptytelegramUpdate
response, which causes assertions inSendFunc
to fail.GetUpdatesFunc
may be still called and new telegram update is created for same token. This breaks telegram update processing logic, andSendFunc
gets called with the error parameter, which also breaks assertions.Some of these failures were observed here: https://github.com/go-pkgz/auth/actions/runs/10632296696/job/29474964583?pr=214#step:6:778