algorand / algorand/go-algorand

Fix Slow DevMode Test (TestKeyRegistration)

オープン
#3,255 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
SkippedTests Team Carbon-11 tech debt
主要言語
Go
スター
1.4k
フォーク
537
平均マージ
1日 6時間
マージ済み PR(30日)
17

説明

### 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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。