Skip to content

Make jar extraction multi-process safe #2552

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 1 commit into from
Aug 25, 2023

Conversation

IlyaMuravjov
Copy link
Collaborator

Description

Sometimes either under heavy loud or when running UtBot in IDE and via tests in parallel, UtBot may crush because its own jars are locked by other processes, to avoid that this PR lets UtBot dynamically change locations to which it extracts jars.

How to test

Manual tests

  • Open ../Temp/UTBot/utbot-instrumentation/0/utbot-instrumentation-shadow.jar with any program (e.g. run ping google.com -t < utbot-instrumentation-shadow.jar on Windows)
  • Ensure you can't delete utbot-instrumentation-shadow.jar manually anymore
  • Recompile utbot (make sure compilation takes place after the previous step and output isn't cached)
  • Generate unit test for any method

UtBot should recognise that it can't update ../Temp/UTBot/utbot-instrumentation/0/utbot-instrumentation-shadow.jar and extract new instrumentation jar to ../Temp/UTBot/utbot-instrumentation/1/utbot-instrumentation-shadow.jar.

Self-check list

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

@IlyaMuravjov IlyaMuravjov added comp-instrumented-process Issue is related to Instrumented process ctg-bug-fix PR is fixing a bug labels Aug 24, 2023
@EgorkaKulikov EgorkaKulikov merged commit 1931f26 into main Aug 25, 2023
@EgorkaKulikov EgorkaKulikov deleted the ilya_m/multi-process-safe-jar branch August 25, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-instrumented-process Issue is related to Instrumented process ctg-bug-fix PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants