amoghrajesh commented on code in PR #51314:
URL: https://github.com/apache/airflow/pull/51314#discussion_r2123075083


##########
go-sdk/worker/runner_test.go:
##########
@@ -36,30 +36,28 @@ import (
 
 const ExecutionAPIServer = "http://localhost:9999/execution";
 
-var TestWorkload = api.ExecuteTaskWorkload{
-       Token: "",
-       // 
{"context_carrier":{},"dag_id":"tutorial_dag","hostname":null,"id":"0196ab8a-5c97-7d4f-b431-e3f49ce20b7f","map_index":-1,"run_id":"manual__2025-05-07T15:48:39.420678+00:00","task_id":"extract","try_number":5}
-       TI: api.TaskInstance{
-               ContextCarrier: new(map[string]any),
-               DagId:          "tutorial_dag",
-               RunId:          "manual__2025-05-07T15:48:39.420678+00:00",
-               TaskId:         "extract",
-               Id:             
uuid.MustParse("0196ab8a-5c97-7d4f-b431-e3f49ce20b7f"),
-               // MapIndex:       new(int),
-               TryNumber: 1,
-       },
-       BundleInfo: api.BundleInfo{
-               Name:    "example_dags",
-               Version: nil,
-       },
-       // LogPath: new(string),
-}
-
-func init() {
+func newTestWorkLoad(id uuid.UUID) api.ExecuteTaskWorkload {

Review Comment:
   Lets pass in the dag id too. Default to "tutorial_dag"
   
   



##########
go-sdk/worker/runner_test.go:
##########
@@ -36,30 +36,28 @@ import (
 
 const ExecutionAPIServer = "http://localhost:9999/execution";
 
-var TestWorkload = api.ExecuteTaskWorkload{
-       Token: "",
-       // 
{"context_carrier":{},"dag_id":"tutorial_dag","hostname":null,"id":"0196ab8a-5c97-7d4f-b431-e3f49ce20b7f","map_index":-1,"run_id":"manual__2025-05-07T15:48:39.420678+00:00","task_id":"extract","try_number":5}
-       TI: api.TaskInstance{
-               ContextCarrier: new(map[string]any),
-               DagId:          "tutorial_dag",
-               RunId:          "manual__2025-05-07T15:48:39.420678+00:00",
-               TaskId:         "extract",
-               Id:             
uuid.MustParse("0196ab8a-5c97-7d4f-b431-e3f49ce20b7f"),
-               // MapIndex:       new(int),
-               TryNumber: 1,
-       },
-       BundleInfo: api.BundleInfo{
-               Name:    "example_dags",
-               Version: nil,
-       },
-       // LogPath: new(string),
-}
-
-func init() {

Review Comment:
   Yeah init isnt the best way around there!



##########
go-sdk/worker/runner_test.go:
##########
@@ -72,17 +70,18 @@ func TestWorkerSuite(t *testing.T) {
        suite.Run(t, &WorkerSuite{})
 }
 
-func (s *WorkerSuite) SetupTest() {
+func (s *WorkerSuite) SetupSuite() {
        s.worker = New(slog.Default())
 
        s.transport = httpmock.NewMockTransport()
        client, err := api.NewClient(ExecutionAPIServer, 
api.WithRoundTripper(s.transport))
        s.Require().NoError(err)
-
+       s.worker.(*worker).heartbeatInterval = 100 * time.Millisecond
        s.worker.(*worker).client = client
 }
 
 func (s *WorkerSuite) TestWithServer() {
+       s.T().Parallel()

Review Comment:
   Not right now, but in a follow-up, we should limit the number of goroutines 
we run in the CI (GO Sdk tests)



-- 
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