-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
functional-tester: move checker logic to cluster #6666
Conversation
} | ||
|
||
func newHashChecker(tt *tester) Checker { return &hashChecker{tt} } | ||
func newHashChecker(c *cluster) Checker { return &hashChecker{hashAndRevGetter(c)} } |
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.
change this to newHashChecker(hrg hashAndRevGetter) convert cluster to hrg outside the new func. it is cleaner.
|
||
func (hc *hashChecker) Check() (err error) { | ||
plog.Printf("%s fetching current revisions...", hc.tt.logPrefix()) |
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.
@gyuho do we still want this log prefix thing?
Members []*member | ||
|
||
stressBuilder stressBuilder | ||
agents []agentConfig |
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.
still keep the empty space between different fields sections?
LGTM. defer to @gyuho |
@@ -24,14 +24,18 @@ type Checker interface { | |||
Check() error | |||
} | |||
|
|||
type hashAndRevGetter interface { | |||
getRevisionHash() (map[string]int64, map[string]int64, error) |
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.
probably name the returned stuff.
@@ -109,6 +101,12 @@ func (c *cluster) bootstrap() error { | |||
go c.Stressers[i].Stress() | |||
} | |||
|
|||
if c.consistencyCheck && !c.v2Only { | |||
c.Checker = newHashChecker(c) |
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.
newHashChecker(hashAndRevGetter(c)) so you know that you do not give the hashchecker access to all methods on cluster.
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.
got it
I move the checker logic from tester to cluster so that stressers and checkers can be initialized at the same time. this is useful because some checker depends on stressers.
f3b4344
to
7d86d10
Compare
lgtm. thanks! |
I move the checker logic from tester to cluster so that stressers and checkers can be initialized at the same time.
this is useful because some checker depends on stressers.