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

Implement a VirtualClock to make tests more efficient and reliable #389

Open
AndrejMitrovic opened this issue Oct 18, 2019 · 2 comments
Open
Assignees
Milestone

Comments

@AndrejMitrovic
Copy link
Member

@AndrejMitrovic AndrejMitrovic commented Oct 18, 2019

We already use something similar for our BanManager tests, where we override the BanManager's clock routine to return a "fake" clock time. Stellar-core does something similar for its entire test-suite, and especially for the SCP tests. With a virtual clock we can make tests more efficient, and we can simulate arbitrary delays without having to physically wait for the wall clock time to advance.

@AndrejMitrovic AndrejMitrovic self-assigned this Oct 18, 2019
@AndrejMitrovic AndrejMitrovic removed their assignment Nov 13, 2019
@AndrejMitrovic AndrejMitrovic self-assigned this Dec 2, 2019
@bpalaggi bpalaggi added this to To do in Sprint #8 (2019-10-29 to 2019-11-12) via automation Dec 2, 2019
@bpalaggi bpalaggi added this to the 2. Validator milestone Dec 2, 2019
@bpalaggi bpalaggi moved this from To do to In progress (Max 4) in Sprint #8 (2019-10-29 to 2019-11-12) Dec 3, 2019
@bpalaggi bpalaggi moved this from In progress (Max 5) to Review/Testing (Max 2) in Sprint #8 (2019-10-29 to 2019-11-12) Dec 12, 2019
@bpalaggi bpalaggi added this to To do in Sprint #9 (2020-01-07 to 2020-01-20) via automation Jan 7, 2020
@bpalaggi bpalaggi removed this from Review/Testing (Max 2) in Sprint #8 (2019-10-29 to 2019-11-12) Jan 7, 2020
@Geod24 Geod24 moved this from To do to In progress (Max 5) in Sprint #9 (2020-01-07 to 2020-01-20) Jan 7, 2020
@bpalaggi bpalaggi moved this from In progress (Max 5) to Blocked (Max 1) in Sprint #9 (2020-01-07 to 2020-01-20) Jan 7, 2020
@bpalaggi bpalaggi moved this from Blocked (Max 1) to In progress (Max 5) in Sprint #9 (2020-01-07 to 2020-01-20) Jan 7, 2020
@bpalaggi bpalaggi removed the Story-Points:2 label Jan 7, 2020
@bpalaggi bpalaggi removed this from In progress (Max 5) in Sprint #9 (2020-01-07 to 2020-01-20) Jan 7, 2020
@Geod24

This comment has been minimized.

Copy link
Member

@Geod24 Geod24 commented Jan 22, 2020

Is this becoming more of a priority now that we have SCPD ?

@AndrejMitrovic

This comment has been minimized.

Copy link
Member Author

@AndrejMitrovic AndrejMitrovic commented Feb 3, 2020

Is this becoming more of a priority now that we have SCPD ?

In short: yes, for testing failures. We don't have those tests yet in Agora, but I plan to add them.

Here's some info for the whole team:

So timer's in SCP are only used to track communication failures within a given time-frame. SCP basically does this (pseudocode):

// See Slot.d : timerIDs
startTimer(BALLOT_PROTOCOL_TIMER, &onFailure, 1.seconds * attempt_number);  

... // actually attempt this ballot, this might take some time

// kills the timer before it has the chance to fire
stopTimer(BALLOT_PROTOCOL_TIMER);  

Where onFailure() would really just restart the whole process but also increment attempt_number to gradually increase the timeout. In SCP parlance, there can be multiple rounds of voting for a given slot (block height), these rounds are the Ballots (BallotProtocol). In our yellow paper the "voting round" means a completed externalized block (which may consist of multiple ballots / multiple voting rounds).

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.