@@ -26,6 +26,7 @@ func newExtractionModel(t *testing.T, steps map[extractionStep]stepStatus) *Mode
2626
2727 m := newTestModel (t )
2828 ctx , cancel := context .WithCancel (context .Background ())
29+ t .Cleanup (cancel )
2930 ex := & extractionLogState {
3031 ID : nextExtractionID .Add (1 ),
3132 ctx : ctx ,
@@ -913,6 +914,7 @@ func TestForeground_SwapsCurrentToBackground(t *testing.T) {
913914
914915 // Create a new foreground extraction.
915916 ctx , cancel := context .WithCancel (context .Background ())
917+ t .Cleanup (cancel )
916918 m .ex .extraction = & extractionLogState {
917919 ID : nextExtractionID .Add (1 ),
918920 Filename : "second.pdf" ,
@@ -1051,6 +1053,7 @@ func TestMultipleBgExtractions(t *testing.T) {
10511053
10521054 // Create and background second.
10531055 ctx , cancel := context .WithCancel (context .Background ())
1056+ t .Cleanup (cancel )
10541057 m .ex .extraction = & extractionLogState {
10551058 ID : nextExtractionID .Add (1 ),
10561059 Filename : "b.pdf" ,
@@ -1088,6 +1091,7 @@ func TestStartExtraction_AutoBackgroundsExisting(t *testing.T) {
10881091 // This tests the backgrounding logic directly.
10891092 m .backgroundExtraction ()
10901093 ctx , cancel := context .WithCancel (context .Background ())
1094+ t .Cleanup (cancel )
10911095 m .ex .extraction = & extractionLogState {
10921096 ID : nextExtractionID .Add (1 ),
10931097 Filename : "new.pdf" ,
@@ -1134,6 +1138,7 @@ func TestCtrlQ_CancelsAllBgExtractions(t *testing.T) {
11341138
11351139 // Create another foreground extraction.
11361140 ctx , cancel := context .WithCancel (context .Background ())
1141+ t .Cleanup (cancel )
11371142 m .ex .extraction = & extractionLogState {
11381143 ID : nextExtractionID .Add (1 ),
11391144 Filename : "fg2.pdf" ,
@@ -1817,6 +1822,7 @@ func TestDispatch_VendorCrossReference(t *testing.T) {
18171822 require .NoError (t , sdb .Stage (ops ))
18181823
18191824 ctx , cancel := context .WithCancel (context .Background ())
1825+ t .Cleanup (cancel )
18201826 defer cancel ()
18211827 ex := & extractionLogState {
18221828 ID : nextExtractionID .Add (1 ),
@@ -1885,6 +1891,7 @@ func TestDispatch_InvalidProjectIDShowsError(t *testing.T) {
18851891 require .NoError (t , sdb .Stage (ops ))
18861892
18871893 ctx , cancel := context .WithCancel (context .Background ())
1894+ t .Cleanup (cancel )
18881895 defer cancel ()
18891896 ex := & extractionLogState {
18901897 ID : nextExtractionID .Add (1 ),
@@ -1950,6 +1957,7 @@ func TestDispatch_OffsetCrossReference(t *testing.T) {
19501957 require .NoError (t , sdb .Stage (ops ))
19511958
19521959 ctx , cancel := context .WithCancel (context .Background ())
1960+ t .Cleanup (cancel )
19531961 defer cancel ()
19541962 ex := & extractionLogState {
19551963 ID : nextExtractionID .Add (1 ),
@@ -2032,6 +2040,7 @@ func TestDispatch_DuplicateVendorDedup(t *testing.T) {
20322040 require .NoError (t , sdb .Stage (ops ))
20332041
20342042 ctx , cancel := context .WithCancel (context .Background ())
2043+ t .Cleanup (cancel )
20352044 defer cancel ()
20362045 ex := & extractionLogState {
20372046 ID : nextExtractionID .Add (1 ),
@@ -2102,6 +2111,7 @@ func TestDispatch_DuplicateApplianceDedup(t *testing.T) {
21022111 require .NoError (t , sdb .Stage (ops ))
21032112
21042113 ctx , cancel := context .WithCancel (context .Background ())
2114+ t .Cleanup (cancel )
21052115 defer cancel ()
21062116 ex := & extractionLogState {
21072117 ID : nextExtractionID .Add (1 ),
@@ -2163,6 +2173,7 @@ func TestDispatch_TransactionRollbackOnFailure(t *testing.T) {
21632173 require .NoError (t , sdb .Stage (ops ))
21642174
21652175 ctx , cancel := context .WithCancel (context .Background ())
2176+ t .Cleanup (cancel )
21662177 defer cancel ()
21672178 ex := & extractionLogState {
21682179 ID : nextExtractionID .Add (1 ),
0 commit comments