Skip to content

Commit 66d7da1

Browse files
committed
Re-enable some async close/interrupt tests
1 parent 003e50a commit 66d7da1

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

test/jdk/java/lang/Thread/virtual/NioChannels.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,10 @@ public void testSocketChannelWrite() throws Exception {
116116

117117
// write should block
118118
ByteBuffer bb = ByteBuffer.allocate(100*1024);
119-
long total = 0;
120119
for (int i=0; i<1000; i++) {
121120
int n = sc1.write(bb);
122121
assertTrue(n > 0);
123-
total += n;
124122
bb.clear();
125-
if ((i % 50) == 0) {
126-
System.out.println("wrote: " + total);
127-
}
128123
}
129124
}
130125
});
@@ -133,7 +128,6 @@ public void testSocketChannelWrite() throws Exception {
133128
/**
134129
* SocketChannel close while virtual thread blocked in read.
135130
*/
136-
@Test(enabled=false)
137131
public void testSocketChannelReadAsyncClose() throws Exception {
138132
TestHelper.runInVirtualThread(() -> {
139133
try (var connection = new Connection()) {
@@ -150,7 +144,6 @@ public void testSocketChannelReadAsyncClose() throws Exception {
150144
/**
151145
* Virtual thread interrupted while blocked in SocketChannel read.
152146
*/
153-
@Test(enabled=false)
154147
public void testSocketChannelReadInterrupt() throws Exception {
155148
TestHelper.runInVirtualThread(() -> {
156149
try (var connection = new Connection()) {
@@ -169,7 +162,6 @@ public void testSocketChannelReadInterrupt() throws Exception {
169162
/**
170163
* SocketChannel close while virtual thread blocked in write.
171164
*/
172-
@Test(enabled=false)
173165
public void testSocketChannelWriteAsyncClose() throws Exception {
174166
TestHelper.runInVirtualThread(() -> {
175167
try (var connection = new Connection()) {
@@ -190,7 +182,6 @@ public void testSocketChannelWriteAsyncClose() throws Exception {
190182
/**
191183
* Virtual thread interrupted while blocked in SocketChannel write.
192184
*/
193-
@Test(enabled=false)
194185
public void testSocketChannelWriteInterrupt() throws Exception {
195186
TestHelper.runInVirtualThread(() -> {
196187
try (var connection = new Connection()) {
@@ -282,7 +273,6 @@ public void testServerSocketChannelAccept2() throws Exception {
282273
/**
283274
* SeverSocketChannel close while virtual thread blocked in accept.
284275
*/
285-
@Test(enabled=false)
286276
public void testServerSocketChannelAcceptAsyncClose() throws Exception {
287277
TestHelper.runInVirtualThread(() -> {
288278
try (var ssc = ServerSocketChannel.open()) {
@@ -301,7 +291,6 @@ public void testServerSocketChannelAcceptAsyncClose() throws Exception {
301291
/**
302292
* Virtual thread interrupted while blocked in ServerSocketChannel accept.
303293
*/
304-
@Test(enabled=false)
305294
public void testServerSocketChannelAcceptInterrupt() throws Exception {
306295
TestHelper.runInVirtualThread(() -> {
307296
try (var ssc = ServerSocketChannel.open()) {

0 commit comments

Comments
 (0)