Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InitializeTestLCD timeouts when nValidators > 1 #2339

Closed
4 tasks done
fedekunze opened this issue Sep 14, 2018 · 3 comments · Fixed by #2452
Closed
4 tasks done

InitializeTestLCD timeouts when nValidators > 1 #2339

fedekunze opened this issue Sep 14, 2018 · 3 comments · Fixed by #2452
Assignees

Comments

@fedekunze
Copy link
Collaborator

fedekunze commented Sep 14, 2018

Summary of Bug

Can't run test LCD on because it timeouts when setting out nValidators > 2

Steps to Reproduce

On client/lcd/lcd_test.go I defined:

cleanup, pks, port := InitializeTestLCD(t, 2, []sdk.AccAddress{addr})

Which after 60s timeouts:

E[09-14|13:03:51.561] Couldn't connect to any seeds                module=p2p 
LADDR tcp://0.0.0.0:54870
E[09-14|13:04:21.565] Couldn't connect to any seeds                module=p2p
Tests timed out after 60000ms

After printing different steps in the code it seems that the error comes from this part of the function:

node, err := startTM(config, logger, genDoc, privVal, app)
require.NoError(t, err)
tests.WaitForNextHeightTM(tests.ExtractPortFromAddress(config.RPC.ListenAddress))


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@mossid
Copy link
Contributor

mossid commented Sep 14, 2018

GaiaAppGenState allocates equal power to initial validators:

validator, stakeData.Pool, issuedDelShares = validator.AddTokensFromDel(stakeData.Pool, freeFermionVal)

So node does not start when nValidator > 1. Also see #1373 (comment).

I think we can write something like TestGaiaAppGenState, which allocates voting power depending on its input.

@fedekunze
Copy link
Collaborator Author

@mossid also genesis.go has a very low test coverage (51.2%)

@alexanderbez
Copy link
Contributor

So ended up digging a long time into this (both TM SDK) and @mossid is correct, It boils down to GaiaAppGenState (because init chainer on TM relay gets called which sends the app state that has equal power for each validator). So I'll be writing a test version of that.

Also throughout this process, I've realized the genesis logic and implementation as well as the higher level commands calling it, is pretty convoluted, messy and complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants