Skip to content

Commit

Permalink
tapchannel: adjust timing for quit and cancel test
Browse files Browse the repository at this point in the history
Testing aux signer quit behavior involved building a job queue and then
checking that some portion of the jobs were skipped, and that the last
job was not processed. This led to racy behavior if the job queue was
too short, or the delay after sending a signal was too long. Using a
larger queue and shorter delay reduces the odds of a race here.
  • Loading branch information
jharveyb committed Oct 11, 2024
1 parent 7ebb640 commit b6a7d60
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tapchannel/auf_leaf_signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var (
}

// sig job batch size when making more that one sig job.
numSigJobs = int32(10)
numSigJobs = int32(25)

// Threshold for trying to cancel or quit the aux leaf signer (allow
// the signer to complete a third of the batch).
Expand Down Expand Up @@ -207,7 +207,6 @@ func TestAuxLeafSignerCancelAndQuit(t *testing.T) {
// Another component could have sent the cancel signal; we'll
// send that before the quit signal.
close(cancelChan)
time.Sleep(time.Millisecond)

// Send the quit signal; jobs at the end of the batch should not
// be processed.
Expand Down

0 comments on commit b6a7d60

Please sign in to comment.