Oliver Okrongli | KotlinConf 2024, May 22–24, Copenhagen
all speakers

Oliver Okrongli

Oliver Okrongli

Multiplatform Software at infix

Oliver is an experienced developer and has been shaping and creating software from backend to frontends. He loves the productivity of working with Kotlin Multiplatform and has contributed to several libraries of the Kotlin ecosystem as well as the Kotlin compiler. Can be found on GitHub (OliverO2) and the kotlinlang Slack (Oliver O).

When not developing, he is most probably in deep talks, dancing, snowboarding or F18 catamaran sailing whenever he gets a chance.

Mastering Concurrency: End-to-End Stress Testing with Kotlin Multiplatform

Distributed systems may expose races, lockups, and other intermittent faults in production. A simple chat app may fail to show an incoming message, but only after running correctly for hours with 1500 active clients. Is it the frontend’s UI failing to update, a missing WebSocket transmission, the backend not synchronizing a session, or something else?

We want to find, analyze and fix such errors efficiently, before a roll-out. To observe real-world behavior, we need do end-to-end testing, with all sub-systems interacting like they do in production, fully multi-threaded, and across client-server boundaries.

But how can we analyze intermittent faults in a distributed system driven by massive parallelism? Even modern telemetry with its distributed logging and tracing will rarely provide the exact information we need. Logs frequently overwhelm us. Running thousands of parallel debugging sessions is impractical.

Let’s dive into a world of efficient, real-world end-to-end testing with Kotlin Multiplatform! Explore how to integrate a JVM backend and multiplatform frontends on a single JVM for testing, using Kotest, a Ktor server test engine and thousands of headless Compose Multiplatform clients. Learn how minimal-overhead instrumentation can shorten testing times and answer the question “what got us here” when errors materialize. Access the entire distributed system via a single debugger, set a breakpoint on the intermittent fault condition, go for lunch, then use your debugger’s superpowers to analyze.

Take away techniques and ready-to-use code examples which make end-to-end testing more efficient and work independently of frameworks used.

Topics covered include: • System design considerations. • Lightweight, focused in-memory tracing. • Making critical sections of client and server code meet at the right time. • Provoking collisions and hitting capacity limits in a focused manner. • Using Kotest’s non-deterministic matchers, and clues (context information) in high-concurrency scenarios. • Avoiding common pitfalls when orchestrating parallelism and inspecting mutable state across thread boundaries.