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

Remove unused "dirtyStuff" from test suite #852

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,10 @@ package org.typelevel.log4cats.slf4j
package internal

import cats.effect.IO
import java.util.concurrent.Executors
import java.util.concurrent.ThreadFactory
import org.slf4j.MDC
import munit.CatsEffectSuite
import scala.concurrent.ExecutionContext
import scala.concurrent.ExecutionContextExecutorService

class Slf4jLoggerInternalSuite extends CatsEffectSuite {

object dirtyStuff {

def namedSingleThreadExecutionContext(name: String): ExecutionContextExecutorService =
ExecutionContext.fromExecutorService(
Executors.newSingleThreadExecutor(new ThreadFactory() {
def newThread(r: Runnable): Thread = new Thread(r, name)
})
)

def killThreads(threads: List[ExecutionContextExecutorService]) = threads.foreach { thread =>
try thread.shutdownNow()
catch {
case e: Throwable =>
Console.err.println("Couldn't shutdown thread")
e.printStackTrace()
}
}
}

test("Slf4jLoggerInternal resets after logging") {
val variable = "foo"
val initial = "yellow"
Expand Down