Skip to content

Commit

Permalink
[perf_tests]Removed some EventBus tests
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 58a800a69c02058c509b7054a1c383f75aa62a36
  • Loading branch information
nikitaBarkov authored and intellij-monorepo-bot committed Jun 21, 2024
1 parent 545abfd commit 15a5274
Showing 1 changed file with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,7 @@ class IdeLaunchEventTest {
EventsBus.unsubscribeAll()
}

@RepeatedTest(value = 5)
fun `events for ide launch should be fired`(testInfo: TestInfo) {
val firedEvents = mutableListOf<Event>()
EventsBus.subscribe(this) { event: IdeBeforeLaunchEvent -> firedEvents.add(event) }
EventsBus.subscribe(this) { event: IdeLaunchEvent -> firedEvents.add(event) }
EventsBus.subscribe(this) { event: IdeBeforeKillEvent -> firedEvents.add(event) }
EventsBus.subscribe(this) { event: IdeAfterLaunchEvent -> firedEvents.add(event) }

val context = Starter.newContext(testInfo.hyphenateWithClass(), TestCases.IU.withProject(NoProject).useRelease())

context.runIDE(
commands = CommandChain().exitApp(),
runTimeout = 5.seconds,
expectedKill = true
)

runBlocking(Dispatchers.IO) {
eventually(duration = 2.seconds, poll = 100.milliseconds) {
firedEvents.shouldHaveSize(4)
}
}

assertSoftly {
firedEvents.shouldForAtLeastOne { it is IdeBeforeLaunchEvent }
firedEvents.shouldForAtLeastOne { it is IdeBeforeLaunchEvent }
firedEvents.shouldForAtLeastOne { it is IdeBeforeKillEvent }
firedEvents.shouldForAtLeastOne { it is IdeAfterLaunchEvent }
}
}

@RepeatedTest(value = 5)
@RepeatedTest(value = 2)
fun `events for twice ide launch should be fired`(testInfo: TestInfo) {
val firedEvents = mutableListOf<Event>()
EventsBus.subscribe(this) {
Expand Down

0 comments on commit 15a5274

Please sign in to comment.