File tree Expand file tree Collapse file tree
sdks/go/pkg/beam/testing/ptest Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package ptest
1919import (
2020 "context"
2121 "flag"
22+ "fmt"
2223 "os"
2324 "testing"
2425
@@ -95,7 +96,17 @@ func MainCalled() bool {
9596// Run runs a pipeline for testing. The semantics of the pipeline is expected
9697// to be verified through passert.
9798func Run (p * beam.Pipeline ) error {
98- _ , err := beam .Run (context .Background (), getRunner (), p )
99+ r := getRunner ()
100+ _ , err := beam .Run (context .Background (), r , p )
101+ // Until a few versions from now (say, v2.56),
102+ // if there's an error, and
103+ // the runner is prism, and it was the set default runner, but not a manually specificed runner via the flag
104+ // augment the error with instructions to switch back to the direct runner.
105+ if err != nil && r == "prism" && r == defaultRunnerOverride && r != * Runner {
106+ err = fmt .Errorf ("%w\n error may be due to Apache Beam Go's migration from the direct runner to the prism runner." +
107+ " While the failure(s) should be fixed, you can continue to use the direct runner with this TestMain override:" +
108+ " `func TestMain(m *testing.M) { ptest.MainWithDefault(m, \" direct\" ) }`" , err )
109+ }
99110 return err
100111}
101112
You can’t perform that action at this time.
0 commit comments