Skip to content

Commit

Permalink
Notes
Browse files Browse the repository at this point in the history
  • Loading branch information
pyamsoft committed Nov 10, 2024
1 parent 9a5983a commit f783927
Showing 1 changed file with 36 additions and 31 deletions.
67 changes: 36 additions & 31 deletions server/src/test/java/com/pyamsoft/tetherfi/server/ProxySetupTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,45 @@ import kotlin.time.Duration.Companion.seconds

class ProxySetupTest {

@Test
fun setupNormal(): Unit = runBlockingWithDelays {
setupProxy(
this,
isLoggingEnabled = true,
proxyPort = 5553,
) {
delay(5.seconds)
/**
* It works right?
*/
@Test
fun setupNormal(): Unit = runBlockingWithDelays {
setupProxy(
this,
isLoggingEnabled = true,
proxyPort = 5553,
) {
delay(5.seconds)
}
}
}

@Test
fun socketCreatorExceptionIsCaught(): Unit = runBlockingWithDelays {
setupProxy(
this,
isLoggingEnabled = true,
proxyPort = 5555,
testSocketCrash = true,
) {
delay(5.seconds)
/** On files with lower memory like Android 7 or 8, sometimes opening the server
* socket crashes with Too Many Open Files. We want to catch the problem and show an error in the app, instead of having the app crash and die */
@Test
fun socketCreatorExceptionIsCaught(): Unit = runBlockingWithDelays {
setupProxy(
this,
isLoggingEnabled = true,
proxyPort = 5555,
testSocketCrash = true,
) {
delay(5.seconds)
}
}
}

/** We also are prepared to handle when a socket fails to open right? */
@Test
fun yoloFailThrows(): Unit = runBlockingWithDelays {
setupProxy(
this,
isLoggingEnabled = true,
proxyPort = 5554,
expectServerFail = true,
appEnv = { updateYolo(true) },
) {
delay(5.seconds)
/** We also are prepared to handle when a socket fails to open right? */
@Test
fun yoloFailThrows(): Unit = runBlockingWithDelays {
setupProxy(
this,
isLoggingEnabled = true,
proxyPort = 5554,
expectServerFail = true,
appEnv = { updateYolo(true) },
) {
delay(5.seconds)
}
}
}
}

0 comments on commit f783927

Please sign in to comment.