-
Notifications
You must be signed in to change notification settings - Fork 518
Description
Subject of the issue
This test seems to run too slow when -race is enabled, leading to timeout failures.
accountParticipationTransitions_test.go:108:
Error Trace: accountParticipationTransitions_test.go:108
Error: Received unexpected error:
HTTP 400 Bad Request: {"message":"timeout while flushing changes, check results manually"}
Test: TestKeyRegistration
Steps to reproduce
- Enable
-racewhen running the test. - Run test in an environment with limited resources.
Possible solutions
The timeout happens in node.go / InstallParticipationKey(...), it is hardcoded to 500 milliseconds. Increasing that timeout may be an option, but it is less than ideal to have delays like this in a REST endpoint.
A better option would be to change the response type from 200 OK to 202 OK Accepted. By returning the ParticipationID the user can check for the new key themselves and wait however long they like.
If we change to 202 OK Accepted the OpenAPI documentation needs to be updated in daemon/algod/api/algod.oas2.json and the TestKeyRegistration logic needs to be changed to wait until the new keys appear. There are probably some other tests that check for 200 OK that also need to be changed.
The test also needs to be re-enabled.