Skip to content

Commit

Permalink
Adapt to the changes in AbstractChannel (#2344)
Browse files Browse the repository at this point in the history
Remove the temporary workarounds from CI build

Related to #1873
  • Loading branch information
violetagg committed Jun 30, 2022
1 parent 0918511 commit a45b247
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 32 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/check_transport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,16 @@ jobs:
fetch-depth: 0 #needed by spotless
- uses: actions/checkout@v3
with:
# TODO temporary https://github.com/netty-contrib/codec-haproxy/pull/7
repository: violetagg/codec-haproxy
repository: netty-contrib/codec-haproxy
path: codec-haproxy
ref: remove-forBuffer
- uses: actions/checkout@v3
with:
# TODO temporary https://github.com/netty-contrib/codec-extras/pull/8
repository: violetagg/codec-extras
repository: netty-contrib/codec-extras
path: codec-extras
ref: port-to-buffer
- uses: actions/checkout@v3
with:
# TODO temporary https://github.com/netty-contrib/socks-proxy/pull/9
repository: violetagg/socks-proxy
repository: netty-contrib/socks-proxy
path: socks-proxy
ref: remove-forBuffer
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void doTestFormatChannel(TestChannel channel) {
.isEqualTo(channelStr.replace(ReactorNetty.ORIGINAL_CHANNEL_ID_PREFIX, "[") + " testFormatWithChannel");
}

static class TestChannel extends AbstractChannel {
static class TestChannel extends AbstractChannel<Channel, SocketAddress, SocketAddress> {

final SocketAddress localAddress;
final SocketAddress remoteAddress;
Expand All @@ -124,21 +124,11 @@ static class TestChannel extends AbstractChannel {
this.remoteAddress = remoteAddress;
}

@Override
public SocketAddress localAddress() {
return localAddress0();
}

@Override
protected SocketAddress localAddress0() {
return localAddress;
}

@Override
public SocketAddress remoteAddress() {
return remoteAddress0();
}

@Override
protected SocketAddress remoteAddress0() {
return remoteAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ void testEventLoopMetrics() throws InterruptedException {
log.warn("operation interrupted", e);
return;
}
assertThat(getGaugeValue(EVENT_LOOP_PREFIX + PENDING_TASKS, tags)).isEqualTo(10);
// 10 tasks added by us, and a listener for child channel registration
assertThat(getGaugeValue(EVENT_LOOP_PREFIX + PENDING_TASKS, tags)).isEqualTo(11);
latch.countDown();
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,13 @@ void testConnectionPoolPendingAcquireSize() throws Exception {
.observe((conn, state) -> {
if (state == STREAM_CONFIGURED) {
counter.incrementAndGet();
conn.onTerminate()
.subscribe(null,
t -> conn.channel().executor().execute(() -> {
if (counter.decrementAndGet() == 0) {
latch.countDown();
}
}),
() -> conn.channel().executor().execute(() -> {
if (counter.decrementAndGet() == 0) {
latch.countDown();
}
conn.channel()
.closeFuture()
.addListener(f ->
conn.channel().executor().execute(() -> {
if (counter.decrementAndGet() == 0) {
latch.countDown();
}
}));
}
});
Expand Down

0 comments on commit a45b247

Please sign in to comment.