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

Task/remove coroutines dependency #1712

Merged
merged 2 commits into from
Sep 19, 2023
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
1 change: 0 additions & 1 deletion packages/patrol/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ android {
implementation "org.http4k:http4k-client-apache"
implementation "org.http4k:http4k-server-ktorcio"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2"

testImplementation "org.jetbrains.kotlin:kotlin-test"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,6 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer
}

override fun markPatrolAppServiceReady() {
PatrolServer.appReady.set(true)
PatrolServer.appReady.open()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,8 @@ public PatrolAppServiceClient createAppServiceClient() {
public void waitForPatrolAppService() {
final String TAG = "PatrolJUnitRunner.setUp(): ";

try {
Logger.INSTANCE.i(TAG + "Waiting for PatrolAppService to report its readiness...");
PatrolServer.Companion.getAppReadyFuture().get();
} catch (InterruptedException | ExecutionException e) {
Logger.INSTANCE.e(TAG + "Exception was thrown when waiting for appReady: ", e);
throw new RuntimeException(e);
}
Logger.INSTANCE.i(TAG + "Waiting for PatrolAppService to report its readiness...");
PatrolServer.Companion.getAppReady().block();

Logger.INSTANCE.i(TAG + "PatrolAppService is ready to report Dart tests");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package pl.leancode.patrol

import android.os.ConditionVariable
import androidx.test.platform.app.InstrumentationRegistry
import com.google.common.util.concurrent.SettableFuture
import org.http4k.core.ContentType
import org.http4k.filter.ServerFilters
import org.http4k.server.Http4kServer
import org.http4k.server.KtorCIO
import org.http4k.server.asServer
import java.util.concurrent.Future

class PatrolServer {
private val envPortKey = "PATROL_PORT"
Expand Down Expand Up @@ -44,9 +43,7 @@ class PatrolServer {
}

companion object {
val appReady: SettableFuture<Boolean> = SettableFuture.create()
val appReadyFuture: Future<Boolean>
get() = appReady
val appReady: ConditionVariable = ConditionVariable()
}
}

Expand Down
Loading