Skip to content
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

Increase cody.ignore.policy.timeout #2135

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ fun Test.sharedIntegrationTestConfig(buildCodyDir: File, mode: String) {
"cody.autocomplete.enableFormatting" to
(project.property("cody.autocomplete.enableFormatting") as String? ?: "true"),
"cody.integration.testing" to "true",
"cody.ignore.policy.timeout" to 500, // Increased to 500ms as CI tends to be slower
"cody.ignore.policy.timeout" to 1500, // Increased to 1500ms as CI tends to be slower
"idea.test.execution.policy" to "com.sourcegraph.cody.test.NonEdtIdeaTestExecutionPolicy",
"test.resources.dir" to resourcesDir.absolutePath)

Expand Down
4 changes: 4 additions & 0 deletions src/main/kotlin/com/sourcegraph/cody/ignore/IgnoreOracle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.runInEdt
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.service
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.fileEditor.FileEditorManager
Expand All @@ -29,6 +30,8 @@ enum class IgnorePolicy(val value: String) {
*/
@Service(Service.Level.PROJECT)
class IgnoreOracle(private val project: Project) {
private val logger = Logger.getInstance(IgnoreOracle::class.java)

data class CacheEntry(val policy: IgnorePolicy, val timestampMsec: Long)

private val cache = SLRUMap<String, CacheEntry>(100, 100)
Expand Down Expand Up @@ -136,6 +139,7 @@ class IgnoreOracle(private val project: Project) {
return try {
completable.get(policyAwaitTimeoutMs, TimeUnit.MILLISECONDS)
} catch (timedOut: TimeoutException) {
logger.warn(timedOut)
null
}
}
Expand Down
Loading