Skip to content

Commit

Permalink
fix: flaky TestSimulatedRetrievalFlow (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Mar 12, 2021
1 parent d4e6175 commit 8b52e5e
Showing 1 changed file with 1 addition and 16 deletions.
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

0 comments on commit 8b52e5e

Please sign in to comment.