Skip to content

Fix Slow DevMode Test (TestKeyRegistration) #3255

@winder

Description

@winder

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SkippedTestsTeam Carbon-11tech debtThings that need re-work for simplification / sanitization to reduce implementation overhead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions