-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-13623][Playground] [Bugfix] During unit tests failing there is no any output #16469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,8 +189,13 @@ func Process(ctx context.Context, cacheService cache.Cache, lc *fs_tool.LifeCycl | |
| return | ||
| } | ||
| if !ok { | ||
| if runOutput.Error != nil { | ||
| runError.Write([]byte(runOutput.Error.Error())) | ||
| // If unit test has some error then error output is placed as RunOutput | ||
| if isUnitTest { | ||
| output, err := GetProcessingOutput(ctx, cacheService, pipelineId, cache.RunOutput, "") | ||
| if err == nil { | ||
| runError.Write([]byte(output)) | ||
| } | ||
|
Comment on lines
+195
to
+197
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need to process this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error occurs only if Receiving this error we do not need to send it to the other methods or to log it, so we just will not use this error, because on the next lines we call |
||
|
|
||
| } | ||
| // Run step is finished, but code contains some error (divide by 0 for example) | ||
| if sdkEnv.ApacheBeamSdk == pb.Sdk_SDK_GO { | ||
|
|
@@ -431,7 +436,7 @@ func processError(ctx context.Context, errorChannel chan error, pipelineId uuid. | |
| func processErrorWithSavingOutput(ctx context.Context, err error, errorOutput []byte, pipelineId uuid.UUID, subKey cache.SubKey, cacheService cache.Cache, errorTitle string, newStatus pb.Status) error { | ||
| logger.Errorf("%s: %s(): err: %s, output: %s\n", pipelineId, errorTitle, err.Error(), errorOutput) | ||
|
|
||
| if err := utils.SetToCache(ctx, cacheService, pipelineId, subKey, fmt.Sprintf("error: %s, output: %s", err.Error(), errorOutput)); err != nil { | ||
| if err := utils.SetToCache(ctx, cacheService, pipelineId, subKey, fmt.Sprintf("error: %s\noutput: %s", err.Error(), errorOutput)); err != nil { | ||
| return err | ||
| } | ||
|
|
||
|
|
@@ -446,7 +451,7 @@ func processRunError(ctx context.Context, errorChannel chan error, errorOutput [ | |
| err := <-errorChannel | ||
| logger.Errorf("%s: Run(): err: %s, output: %s\n", pipelineId, err.Error(), errorOutput) | ||
|
|
||
| if err := utils.SetToCache(ctx, cacheService, pipelineId, cache.RunError, fmt.Sprintf("error: %s, output: %s", err.Error(), string(errorOutput))); err != nil { | ||
| if err := utils.SetToCache(ctx, cacheService, pipelineId, cache.RunError, fmt.Sprintf("error: %s\noutput: %s", err.Error(), string(errorOutput))); err != nil { | ||
| return err | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add an
elsecase to do this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess, no. I removed
runOutput.Errorfield fromrun_output_writer.go. We do not need this field. This error (runOutput.Error.Error()) exists inerrorChanneland be thrown to the log without usingrunError.Write([]byte(runOutput.Error.Error())). So we do not need this one:This PR is to receive an error's output that occurs during the processing of the unit tests. This error output is placed in the cache as a
RunOutputso we need to get this one and keep it to therunErrorvalue but only if it is a unit tests (isUnitTest) and there is an error during processing (!ok)