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

fix flaky TestSimulatedRetrievalFlow #159

Merged
merged 1 commit into from
Mar 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions impl/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,6 @@ func TestSimulatedRetrievalFlow(t *testing.T) {
testCases := map[string]struct {
unpauseRequestorDelay time.Duration
unpauseResponderDelay time.Duration
payForUnseal bool
pausePoints []uint64
}{
"fast unseal, payment channel ready": {
Expand Down Expand Up @@ -770,20 +769,6 @@ func TestSimulatedRetrievalFlow(t *testing.T) {
encodedFVR, err := encoding.Encode(finalVoucherResult)
require.NoError(t, err)
var clientSubscriber datatransfer.Subscriber = func(event datatransfer.Event, channelState datatransfer.ChannelState) {
if event.Code == datatransfer.Accept {
err := dt2.PauseDataTransferChannel(ctx, chid)
require.NoError(t, err)
timer := time.NewTimer(config.unpauseRequestorDelay)
go func() {
<-timer.C
err := dt2.ResumeDataTransferChannel(ctx, chid)
require.NoError(t, err)
if config.payForUnseal {
err := dt2.SendVoucher(ctx, chid, testutil.NewFakeDTType())
require.NoError(t, err)
}
}()
}
if event.Code == datatransfer.Error {
errChan <- struct{}{}
}
Expand Down Expand Up @@ -811,7 +796,7 @@ func TestSimulatedRetrievalFlow(t *testing.T) {
providerAccepted := false
var providerSubscriber datatransfer.Subscriber = func(event datatransfer.Event, channelState datatransfer.ChannelState) {
if event.Code == datatransfer.PauseResponder {
if !config.payForUnseal && !providerAccepted {
if !providerAccepted {
providerAccepted = true
timer := time.NewTimer(config.unpauseResponderDelay)
go func() {
Expand Down