Andrushika commented on code in PR #70141:
URL: https://github.com/apache/airflow/pull/70141#discussion_r3617056151


##########
go-sdk/pkg/worker/runner_test.go:
##########
@@ -252,6 +252,27 @@ func (s *WorkerSuite) TestTaskHeartbeatConflictStopsTask() 
{
        s.NoError(err)
 }
 
+func (s *WorkerSuite) TestTaskHeartbeatNilResponseDoesNotPanic() {
+       id := uuid.New().String()
+       testWorkload := newTestWorkLoad(id, id[:8])
+
+       s.registry.AddDag(testWorkload.TI.DagId).
+               AddTaskWithName(testWorkload.TI.TaskId, func() error {
+                       time.Sleep(250 * time.Millisecond)

Review Comment:
   Non-blocking: Could we avoid `time.Sleep` here? This relies on the heartbeat 
goroutine being scheduled within 250ms. (It could be a flaky test under heavy 
CI load) Maybe the task could wait on a channel signaled by the mocked 
Heartbeat on its second call?
   A second call would also confirm that the heartbeater processed the first 
nil response.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to