forked from UnitTestBot/UTBotJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing long summarization timeouts & mics (UnitTestBot#1151)
* [utbot-rd] fixing long delays in summarization, fixing sarif reports resource root creation, fixing kryo serialization error, fixing idea thread relating problems * [utbot-rd] compilation fix
- Loading branch information
1 parent
d4cb666
commit cad8133
Showing
16 changed files
with
376 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ target/ | |
.idea/ | ||
.gradle/ | ||
*.log | ||
*.rdgen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
utbot-framework/src/main/kotlin/org/utbot/framework/process/RdInstrumenter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.utbot.framework.process | ||
|
||
import com.jetbrains.rd.framework.IProtocol | ||
import kotlinx.coroutines.runBlocking | ||
import mu.KotlinLogging | ||
import org.utbot.framework.process.generated.ComputeSourceFileByClassArguments | ||
import org.utbot.framework.process.generated.rdInstrumenterAdapter | ||
import org.utbot.instrumentation.instrumentation.instrumenter.InstrumenterAdapter | ||
import java.io.File | ||
import java.nio.file.Path | ||
|
||
private val logger = KotlinLogging.logger { } | ||
|
||
class RdInstrumenter(private val protocol: IProtocol): InstrumenterAdapter() { | ||
override fun computeSourceFileByClass( | ||
className: String, | ||
packageName: String?, | ||
directoryToSearchRecursively: Path | ||
): File? = runBlocking { | ||
logger.debug { "starting computeSourceFileByClass with classname - $className" } | ||
val result = try { | ||
protocol.rdInstrumenterAdapter.computeSourceFileByClass.startSuspending( | ||
ComputeSourceFileByClassArguments( | ||
className, | ||
packageName | ||
) | ||
) | ||
} | ||
catch(e: Exception) { | ||
logger.error(e) { "error during computeSourceFileByClass" } | ||
throw e | ||
} | ||
logger.debug { "computeSourceFileByClass result for $className from idea: $result"} | ||
return@runBlocking result?.let { File(it) } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.