algorand / algorand/go-algorand
Fix Slow DevMode Test (TestKeyRegistration)
- 主要语言
- Go
- 星标
- 1.4k
- 派生
- 537
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 18
描述
### 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
1. Enable `-race` when running the test.
2. 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.
贡献指南
评估
这个 Issue 还没有评估数据。