Skip to content

Commit 1130c45

Browse files
authored
Merge pull request #157 from cschleiden/cschleiden/cancel-only-real-timers
Only cancel workflow timers
2 parents 6034491 + 23b8a3f commit 1130c45

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Tests
4141
run: |
4242
go install github.com/jstemmer/go-junit-report/v2@latest
43-
go test -race -count 1 -v ./... 2>&1 | go-junit-report -set-exit-code -iocopy -out "${{ github.workspace }}/report.xml"
43+
go test -timeout 120s -race -count 1 -v ./... 2>&1 | go-junit-report -set-exit-code -iocopy -out "${{ github.workspace }}/report.xml"
4444
4545
4646
- name: Test Summary

tester/tester.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ func (wt *workflowTester[TResult]) scheduleTimer(instance *core.WorkflowInstance
558558

559559
func (wt *workflowTester[TResult]) cancelTimer(instance *core.WorkflowInstance, event history.Event) {
560560
for i, t := range wt.timers {
561-
if t.Instance.InstanceID == instance.InstanceID && t.ScheduleEventID == event.ScheduleEventID {
561+
if t.Instance != nil && t.Instance.InstanceID == instance.InstanceID && t.ScheduleEventID == event.ScheduleEventID {
562562
wt.timers = append(wt.timers[:i], wt.timers[i+1:]...)
563563
break
564564
}

0 commit comments

Comments
 (0)