Repository: bacalhau-project/bacalhau (language: python)

Issue:
long running bacalhau commands not cancel-able with ^C
Repro:
Have a cluster that no longer exists
Point bacalhau CLI at that cluster
type `bacalhau node list`
type ^C

Expected:
Command cancels

Actual:
Command does not respond


Discussion / hints:
To test:
```
export BACALHAU_NODE_CLIENTAPI_HOST=neopets.com
bacalhau node list
```

Fix patch:
diff --git a/cmd/util/api.go b/cmd/util/api.go
index ace2066f1a..ad146b63e4 100644
--- a/cmd/util/api.go
+++ b/cmd/util/api.go
@@ -15,6 +15,7 @@ func GetAPIClient(ctx context.Context) *client.APIClient {
 
 func GetAPIClientV2(ctx context.Context) *clientv2.Client {
 	return clientv2.New(clientv2.Options{
+		Context: ctx,
 		Address: fmt.Sprintf("http://%s:%d", config.ClientAPIHost(), config.ClientAPIPort()),
 	})
 }


Test patch:
diff --git a/pkg/test/scenario/suite.go b/pkg/test/scenario/suite.go
index dfbe77561a..ec783b7d31 100644
--- a/pkg/test/scenario/suite.go
+++ b/pkg/test/scenario/suite.go
@@ -150,6 +150,7 @@ func (s *ScenarioRunner) RunScenario(scenario Scenario) (resultsDir string) {
 	apiServer := stack.Nodes[0].APIServer
 	apiClient := client.NewAPIClient(apiServer.Address, apiServer.Port)
 	apiClientV2 := clientv2.New(clientv2.Options{
+		Context: s.Ctx,
 		Address: fmt.Sprintf("http://%s:%d", apiServer.Address, apiServer.Port),
 	})
 	submittedJob, submitError := apiClient.Submit(s.Ctx, j)