Skip to content

lite2: actually run example tests + clock drift#4487

Merged
melekes merged 6 commits intomasterfrom
anton/example-tests
Feb 27, 2020
Merged

lite2: actually run example tests + clock drift#4487
melekes merged 6 commits intomasterfrom
anton/example-tests

Conversation

@melekes
Copy link
Contributor

@melekes melekes commented Feb 27, 2020

Closes: #4488

Description


For contributor use:

  • Wrote tests
  • Updated CHANGELOG_PENDING.md
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments
  • Re-reviewed Files changed in the Github PR explorer

@melekes melekes force-pushed the anton/example-tests branch from 3e5a184 to c28f427 Compare February 27, 2020 15:34
@melekes melekes marked this pull request as ready for review February 27, 2020 15:59
@melekes melekes self-assigned this Feb 27, 2020
@melekes melekes requested a review from cmwaters February 27, 2020 16:00
Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, as long as the linter is appeased.

UpdatePeriod(1*time.Second),
Logger(log.TestingLogger()),
UpdatePeriod(0), // NOTE: value should be greater than zero
// Logger(log.TestingLogger()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to suppress logger. otherwise you get:

got:
I[2020-02-27|16:15:46.267] Starting light client
I[2020-02-27|16:15:48.270] VerifyHeader                                 height=562 hash=007C948D389C14724D28E542E159E7B98ADCB6D8C81DE62655C5EFA6092DEEC3 vals=8E84DAAFA6FFC6CEF14ADA4B34C12D6B7D28B559444EF6A4F96439E349417713
D[2020-02-27|16:15:48.270] Verify newHeader against trustedHeader       trustedHeight=2 trustedHash=30CBED5E0A85457A6F850370899771F9372250AA6DCA0DF7824FB35C90B7A649 newHeight=562 newHash=007C948D389C14724D28E542E159E7B98ADCB6D8C81DE62655C5EFA6092DEEC3
I[2020-02-27|16:15:48.271] Advanced to new state                        height=562 hash=007C948D389C14724D28E542E159E7B98ADCB6D8C81DE62655C5EFA6092DEEC3
successful update
I[2020-02-27|16:15:48.271] Stopping light client
I[2020-02-27|16:15:48.271] Removing all the data
want:
successful update

@cmwaters
Copy link
Contributor

what about an example test for the auto update?

@melekes
Copy link
Contributor Author

melekes commented Feb 27, 2020

what about an example test for the auto update?

you can investigate if you want. I think it's because we're stripping the monotonic part & using only a single instance (so not using medium time actually)

@codecov-io
Copy link

Codecov Report

Merging #4487 into master will decrease coverage by 0.09%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master    #4487     +/-   ##
=========================================
- Coverage   65.53%   65.43%   -0.1%     
=========================================
  Files         228      228             
  Lines       20250    20259      +9     
=========================================
- Hits        13270    13257     -13     
- Misses       5927     5948     +21     
- Partials     1053     1054      +1
Impacted Files Coverage Δ
lite2/verifier.go 86.11% <100%> (-2.63%) ⬇️
consensus/reactor.go 77.85% <0%> (-1.62%) ⬇️
consensus/state.go 77.47% <0%> (-1.55%) ⬇️
lite2/client.go 72.99% <0%> (-1.27%) ⬇️
p2p/conn/connection.go 80.97% <0%> (+0.25%) ⬆️
blockchain/v0/pool.go 79.16% <0%> (+0.32%) ⬆️
consensus/replay.go 72.54% <0%> (+0.78%) ⬆️
privval/signer_listener_endpoint.go 89.13% <0%> (+2.17%) ⬆️
crypto/secp256k1/secp256k1.go 72.13% <0%> (+2.31%) ⬆️
... and 2 more

@melekes melekes merged commit 3f883bb into master Feb 27, 2020
@melekes melekes deleted the anton/example-tests branch February 27, 2020 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lite2: bring clockDrift from the spec

5 participants