Skip to content

Go. Bug fixes #2031

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

Merged
merged 8 commits into from
Mar 27, 2023
Merged

Go. Bug fixes #2031

merged 8 commits into from
Mar 27, 2023

Conversation

egiptipavel
Copy link
Collaborator

@egiptipavel egiptipavel commented Mar 24, 2023

Description

How to test

Manual tests

Test on utbot-go/go-samples/simple/samples.go and utbot-go/go-samples/simple/supported_types.go files.

Self-check list

Check off the item if the statement is true. Hint: [x] is a marked item.

Please do not delete the list or its items.

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@egiptipavel egiptipavel added ctg-bug-fix PR is fixing a bug lang-go Issue is related to Go support labels Mar 24, 2023
@egiptipavel egiptipavel requested a review from Markoutte March 24, 2023 09:01
@egiptipavel egiptipavel self-assigned this Mar 24, 2023
throw TimeoutException("Timeout exceeded: Worker didn't finish")
val processOutput = InputStreamReader(process.inputStream).readText()
throw TimeoutException(
StringBuilder()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use buildString { } to do the same

@@ -112,7 +112,13 @@ object GoTestCasesGenerator {
val processHasExited = process.waitFor(endOfWorkerExecutionTimeout, TimeUnit.MILLISECONDS)
if (!processHasExited) {
process.destroy()
throw TimeoutException("Timeout exceeded: Worker didn't finish")
val processOutput = InputStreamReader(process.inputStream).readText()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output can be huge. Do this read really necessary?

@@ -132,7 +138,13 @@ object GoTestCasesGenerator {
val processHasExited = process.waitFor(endOfWorkerExecutionTimeout, TimeUnit.MILLISECONDS)
if (!processHasExited) {
process.destroy()
logger.error { "Timeout exceeded: Worker didn't finish" }
val processOutput = InputStreamReader(process.inputStream).readText()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as before

@egiptipavel egiptipavel requested a review from Markoutte March 26, 2023 19:06
@egiptipavel egiptipavel merged commit 86a20d5 into main Mar 27, 2023
@egiptipavel egiptipavel deleted the egiptipavel/go-bug-fixes branch March 27, 2023 08:20
denis-fokin pushed a commit that referenced this pull request Mar 27, 2023
* Fix bug with nested unexported structs

* Delete timeout for worker execution

* Add logging when worker doesn't finish

* Add sample file

* Add message about failed parsing of source code analysis result

* Change StringBuilder on buildString

* Add message about failed starting the worker

(cherry picked from commit 86a20d5)
@alisevych alisevych added this to the 2023.3 Release milestone Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-bug-fix PR is fixing a bug lang-go Issue is related to Go support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go. KlaxonException in IDEA 2022.2.4 Go. Empty test file is generated in a new Go project
3 participants