File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -290,14 +290,22 @@ func newWorkflowTaskPoller(
290290 domain string ,
291291 params workerExecutionParameters ,
292292) * workflowTaskPoller {
293+ /*
294+ Explicit nil handling is needed here. Otherwise, poller.ldaTunnel would not return a nil result
295+ */
296+ var ldaTunnelInterface localDispatcher
297+ if ldaTunnel != nil {
298+ ldaTunnelInterface = ldaTunnel
299+ }
300+
293301 return & workflowTaskPoller {
294302 basePoller : basePoller {shutdownC : params .WorkerStopChannel },
295303 service : service ,
296304 domain : domain ,
297305 taskListName : params .TaskList ,
298306 identity : params .Identity ,
299307 taskHandler : taskHandler ,
300- ldaTunnel : ldaTunnel ,
308+ ldaTunnel : ldaTunnelInterface ,
301309 metricsScope : metrics .NewTaggedScope (params .MetricsScope ),
302310 logger : params .Logger ,
303311 stickyUUID : uuid .New (),
Original file line number Diff line number Diff line change @@ -46,6 +46,21 @@ const (
4646 _testIdentity = "test-worker"
4747)
4848
49+ func Test_newWorkflowTaskPoller (t * testing.T ) {
50+ t .Run ("success with nil ldaTunnel" , func (t * testing.T ) {
51+ poller := newWorkflowTaskPoller (
52+ nil ,
53+ nil ,
54+ nil ,
55+ _testDomainName ,
56+ workerExecutionParameters {})
57+ assert .NotNil (t , poller )
58+ if poller .ldaTunnel != nil {
59+ t .Error ("unexpected not nil ldaTunnel" )
60+ }
61+ })
62+ }
63+
4964func TestLocalActivityPanic (t * testing.T ) {
5065 // regression: panics in local activities should not terminate the process
5166 s := WorkflowTestSuite {logger : testlogger .NewZap (t )}
You can’t perform that action at this time.
0 commit comments