-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix t.Fatal in a goroutine #2062
Conversation
59653ef
to
1bc2ebd
Compare
Test failures are in Sharness tests and are not related. |
@@ -142,6 +142,7 @@ func sizeOfIthFile(i int64) int64 { | |||
} | |||
|
|||
func runFileAddingWorker(n *core.IpfsNode) error { | |||
errs := make(chan error, math.MaxInt32) |
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.
what... what is going on in this test? MaxInt32
?
your changes look good to me, but we should probably reevaluate what this test is doing...
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.
i believe this thing used to just sit, adding a new file every second. it could just as well loop forever.
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 not really used.
Looks good! this may help flush out some issues, especially the ones in bitswap. Those might be the cause of our occasional bitswap test hang. Only thing I would do is to not buffer the error channels, the pattern youre using should work fine with no buffering. |
@whyrusleeping ok thanks for your review. I will wait a bit before for @jbenet or someone else's opinion before removing the error channel buffers though. |
@@ -168,19 +168,31 @@ func PerformDistributionTest(t *testing.T, numInstances, numBlocks int) { | |||
t.Log("Distribute!") | |||
|
|||
wg := sync.WaitGroup{} | |||
errs := make(chan error, 10) |
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.
here this could be make(chan error, len(instances))
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.
(or no buffering)
yeah that sounds good to me, no buffering is fine |
this LGTM, other than no buffers |
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
1bc2ebd
to
57c4188
Compare
Ok, I removed all the buffering. |
This should fix at least part of issue #2043.
License: MIT
Signed-off-by: Christian Couder chriscool@tuxfamily.org