Skip to content

Commit

Permalink
[grid] Removing unused NodeRemovedEvent.java
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Mar 23, 2021
1 parent 056b281 commit 9623950
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 61 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@

package org.openqa.selenium.grid.distributor.local;

import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static org.openqa.selenium.grid.data.Availability.DOWN;
import static org.openqa.selenium.grid.data.Availability.DRAINING;
import static org.openqa.selenium.remote.tracing.HttpTracing.newSpanAsChildOf;

import com.google.common.collect.ImmutableSet;

import org.openqa.selenium.Beta;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.ImmutableCapabilities;
import org.openqa.selenium.RetrySessionRequestException;
import org.openqa.selenium.SessionNotCreatedException;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.concurrent.Regularly;
import org.openqa.selenium.events.EventBus;
import org.openqa.selenium.grid.config.Config;
Expand All @@ -44,7 +40,6 @@
import org.openqa.selenium.grid.data.NodeDrainComplete;
import org.openqa.selenium.grid.data.NodeHeartBeatEvent;
import org.openqa.selenium.grid.data.NodeId;
import org.openqa.selenium.grid.data.NodeRemovedEvent;
import org.openqa.selenium.grid.data.NodeStatus;
import org.openqa.selenium.grid.data.NodeStatusEvent;
import org.openqa.selenium.grid.data.RequestId;
Expand Down Expand Up @@ -75,7 +70,6 @@
import org.openqa.selenium.remote.tracing.Span;
import org.openqa.selenium.remote.tracing.Tracer;
import org.openqa.selenium.status.HasReadyState;
import org.openqa.selenium.WebDriverException;

import java.time.Duration;
import java.util.ArrayList;
Expand All @@ -96,6 +90,11 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static org.openqa.selenium.grid.data.Availability.DOWN;
import static org.openqa.selenium.grid.data.Availability.DRAINING;
import static org.openqa.selenium.remote.tracing.HttpTracing.newSpanAsChildOf;

public class LocalDistributor extends Distributor {

private static final Logger LOG = Logger.getLogger(LocalDistributor.class.getName());
Expand Down Expand Up @@ -291,7 +290,6 @@ public void remove(NodeId nodeId) {
}
} finally {
writeLock.unlock();
bus.fire(new NodeRemovedEvent(nodeId));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@

package org.openqa.selenium.grid.distributor;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.openqa.selenium.grid.data.Availability.DOWN;
import static org.openqa.selenium.grid.data.Availability.UP;
import static org.openqa.selenium.remote.http.Contents.utf8String;
import static org.openqa.selenium.remote.http.HttpMethod.POST;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

Expand All @@ -45,8 +36,8 @@
import org.openqa.selenium.grid.data.CreateSessionRequest;
import org.openqa.selenium.grid.data.CreateSessionResponse;
import org.openqa.selenium.grid.data.DistributorStatus;
import org.openqa.selenium.grid.data.NodeDrainComplete;
import org.openqa.selenium.grid.data.NodeHeartBeatEvent;
import org.openqa.selenium.grid.data.NodeRemovedEvent;
import org.openqa.selenium.grid.data.NodeStatus;
import org.openqa.selenium.grid.data.Session;
import org.openqa.selenium.grid.data.Slot;
Expand Down Expand Up @@ -98,6 +89,15 @@
import java.util.logging.Logger;
import java.util.stream.Collectors;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.openqa.selenium.grid.data.Availability.DOWN;
import static org.openqa.selenium.grid.data.Availability.UP;
import static org.openqa.selenium.remote.http.Contents.utf8String;
import static org.openqa.selenium.remote.http.HttpMethod.POST;

public class DistributorTest {

private static final Logger LOG = Logger.getLogger("Distributor Test");
Expand Down Expand Up @@ -392,7 +392,7 @@ public void testDrainedNodeShutsDownOnceEmpty() throws InterruptedException {
.build();

CountDownLatch latch = new CountDownLatch(1);
bus.addListener(NodeRemovedEvent.listener(ignored -> latch.countDown()));
bus.addListener(NodeDrainComplete.listener(ignored -> latch.countDown()));

Distributor distributor = new LocalDistributor(
tracer,
Expand Down Expand Up @@ -440,7 +440,7 @@ public void drainedNodeDoesNotShutDownIfNotEmpty() throws InterruptedException {
.build();

CountDownLatch latch = new CountDownLatch(1);
bus.addListener(NodeRemovedEvent.listener(ignored -> latch.countDown()));
bus.addListener(NodeDrainComplete.listener(ignored -> latch.countDown()));

Distributor distributor = new LocalDistributor(
tracer,
Expand Down Expand Up @@ -490,7 +490,7 @@ public void drainedNodeShutsDownAfterSessionsFinish() throws InterruptedExceptio
.build();

CountDownLatch latch = new CountDownLatch(1);
bus.addListener(NodeRemovedEvent.listener(ignored -> latch.countDown()));
bus.addListener(NodeDrainComplete.listener(ignored -> latch.countDown()));

Distributor distributor = new LocalDistributor(
tracer,
Expand Down

0 comments on commit 9623950

Please sign in to comment.