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

ZIO Test: Preserve Trace In TestAspect.timeoutWarning #8289

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/shared/src/main/scala/zio/test/TimeoutVariants.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package zio.test

import zio._
import zio.stacktracer.TracingImplicits.disableAutoTrace

trait TimeoutVariants {

Expand Down Expand Up @@ -50,7 +51,7 @@ trait TimeoutVariants {
labels: List[String],
test: ZTest[R, E],
duration: Duration
): ZTest[R, E] =
)(implicit trace: Trace): ZTest[R, E] =
test.raceWith(Live.withLive(showWarning(labels, duration))(_.delay(duration)))(
(result, fiber) => fiber.interrupt *> ZIO.done(result),
(_, fiber) => fiber.join
Expand All @@ -59,7 +60,7 @@ trait TimeoutVariants {
private def showWarning(
labels: List[String],
duration: Duration
): UIO[Unit] =
)(implicit trace: Trace): UIO[Unit] =
ZIO.logWarning(renderWarning(labels, duration))

private def renderWarning(labels: List[String], duration: Duration): String =
Expand Down