-
Notifications
You must be signed in to change notification settings - Fork 78
[Kaizen] Unflake RegularSynchSpec #1045
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,8 @@ class RegularSyncSpec | |
| def sync[T <: Fixture](test: => T): Future[Assertion] = | ||
| Future { | ||
| test | ||
| // this makes sure that actors are all done after the test (believe me, afterEach does not work with mocks) | ||
| TestKit.shutdownActorSystem(testSystem) | ||
| succeed | ||
| } | ||
|
|
||
|
|
@@ -475,7 +477,7 @@ class RegularSyncSpec | |
| peersClient.setAutoPilot(new PeersClientAutoPilot) | ||
| override lazy val branchResolution: BranchResolution = stub[BranchResolution] | ||
| (blockchainReader.getBestBlockNumber _).when().returns(0) | ||
| (branchResolution.resolveBranch _).when(*).returns(NewBetterBranch(Nil)).repeat(10) | ||
| (branchResolution.resolveBranch _).when(*).returns(NewBetterBranch(Nil)).atLeastOnce() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not convinced if this is required but the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the logic in RegularSync will run a retry on failure. the failure is the missing node (vide a bit lower) which should result in some logic and a retry. the 10 used to be 1 a long time ago. |
||
| (blockImport | ||
| .importBlock(_: Block)(_: Scheduler)) | ||
| .when(*, *) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This 'fixture' pretty weird... are there any other tests with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's custom to this test, haven't seen it any other place.