-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-1452] Setup mock consumer before using disk
https://jira.hyperledger.org/browse/FAB-1452 Consider this: 1. Before we bring up a mock producer and mock consumer we need to initialize them so that they output the right offsets. We do this via a process where we add fill-in blocks until we get them to the desired offset. 2. We move messages between the mock producer to the mock consumer via goroutine that fetches a message from the producer's disk (an unbuffered channel) and places it into the consumer's disk (another unbuffered channel). Up until now, before proceeding to step 2, we would only make sure that the producer was set-up. The goroutine then would add a message to the consumer's disk before the consumer was set-up. As a result, the first message we would receive past the setup process would sometimes be the last fill-in message (instead of the first, regular test message). This changeset adds a hook for checking that consumer has been setup and modifies the unit tests so that they use it before proceeding with the message passing between disks. Change-Id: I3b86f67ffe5110a5165d96bf727f2f5dfa4e462f Signed-off-by: Kostas Christidis <kostas@christidis.io>
- Loading branch information
1 parent
8f1e830
commit b8369e5
Showing
4 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters