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

Rewrite SocketPlugin to NIO #21

Merged
merged 9 commits into from
Jan 29, 2019
Merged
Show file tree
Hide file tree
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 @@ -30,7 +30,7 @@
import de.hpi.swa.graal.squeak.nodes.process.GetActiveProcessNode;

public class AbstractSqueakTestCaseWithImage extends AbstractSqueakTestCase {
private static final int TIMEOUT_SECONDS = 50;
private static final int TIMEOUT_SECONDS = 60;
f4lco marked this conversation as resolved.
Show resolved Hide resolved
private static final int PRIORITY_10_LIST_INDEX = 9;

private static PointersObject idleProcess;
Expand Down Expand Up @@ -66,6 +66,8 @@ private static void patchImageForTesting() {
evaluate("Utilities setAuthorInitials: 'GraalSqueak'");
image.getOutput().println("Initializing fresh MorphicUIManager...");
evaluate("Project current instVarNamed: #uiManager put: MorphicUIManager new");
image.getOutput().println("Increasing default timeout...");
patchMethod("TestCase", "defaultTimeout", "defaultTimeout ^ " + TIMEOUT_SECONDS);
f4lco marked this conversation as resolved.
Show resolved Hide resolved
if (!runsOnMXGate()) {
// Patch TestCase>>#performTest, so errors are printed to stderr for debugging purposes.
patchMethod("TestCase", "performTest", "performTest [self perform: testSelector asSymbol] on: Error do: [:e | e printVerboseOn: FileStream stderr. e signal]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ AllocationTest>>testOneGigAllocation=passing
AllocationTest>>testOneMegAllocation=passing
AllocationTest>>testOutOfMemorySignal=ignored
AppRegistryTest>>test01AppsAreBehaviors=passing
ArbitraryObjectSocketTestCase>>testBasics=failing
ArbitraryObjectSocketTestCase>>testBasics=passing
ArrayLiteralTest>>testReservedIdentifiers=passing
ArrayLiteralTest>>testSymbols=passing
ArrayTest>>testAtWrap=passing
Expand Down Expand Up @@ -3550,54 +3550,60 @@ SmartRefStreamTest>>testLargeIntergers=passing
SmartRefStreamTest>>testNotTooLargeIntergers=passing
SmartRefStreamTest>>testSmallInteger=passing
SMTPClientTest>>testMailFrom=passing
SocketStreamTest>>testClassComment=ignored
SocketStreamTest>>testCoverage=ignored
SocketStreamTest>>testNew=ignored
SocketStreamTest>>testNextIntoClose=ignored
SocketStreamTest>>testNextIntoCloseNonSignaling=ignored
SocketStreamTest>>testUnCategorizedMethods=ignored
SocketStreamTest>>testUpTo=ignored
SocketStreamTest>>testUpToAfterCloseNonSignaling=ignored
SocketStreamTest>>testUpToAfterCloseSignaling=ignored
SocketStreamTest>>testUpToAll=ignored
SocketStreamTest>>testUpToAllAfterCloseNonSignaling=ignored
SocketStreamTest>>testUpToAllAfterCloseSignaling=ignored
SocketStreamTest>>testUpToAllAsciiVsBinary=ignored
SocketStreamTest>>testUpToAllCrlfAscii=ignored
SocketStreamTest>>testUpToAllCrlfBinary=ignored
SocketStreamTest>>testUpToAllCrlfCrlfAscii=ignored
SocketStreamTest>>testUpToAllCrlfCrlfBinary=ignored
SocketStreamTest>>testUpToAllEmptyPatternAscii=ignored
SocketStreamTest>>testUpToAllEmptyPatternBinary=ignored
SocketStreamTest>>testUpToAllLimit=ignored
SocketStreamTest>>testUpToAllLongPatternAscii=ignored
SocketStreamTest>>testUpToAllLongPatternBinary=ignored
SocketStreamTest>>testUpToAllMediumPatternAscii=ignored
SocketStreamTest>>testUpToAllMediumPatternBinary=ignored
SocketStreamTest>>testUpToAllShortPatternAscii=ignored
SocketStreamTest>>testUpToAllShortPatternAscii2=ignored
SocketStreamTest>>testUpToAllShortPatternBinary=ignored
SocketStreamTest>>testUpToAllShortPatternBinary2=ignored
SocketStreamTest>>testUpToAllTimeout=ignored
SocketStreamTest>>testUpToAsciiVsBinary=ignored
SocketStreamTest>>testUpToEndClose=ignored
SocketStreamTest>>testUpToEndCloseNonSignaling=ignored
SocketStreamTest>>testUpToMax=ignored
SocketStreamTest>>testUpToTimeout=ignored
SocketTest>>testClientConnect=ignored
SocketTest>>testDataReceive=ignored
SocketTest>>testDataSending=ignored
SocketTest>>testLocalAddress=ignored
SocketTest>>testLocalPort=ignored
SocketTest>>testPeerName=ignored
SocketTest>>testReceiveTimeout=ignored
SocketTest>>testRemoteAddress=ignored
SocketTest>>testRemotePort=ignored
SocketTest>>testSendTimeout=ignored
SocketTest>>testServerAccept=ignored
SocketStreamTest>>testClassComment=passing
SocketStreamTest>>testCoverage=passing
SocketStreamTest>>testNew=passing
SocketStreamTest>>testNextIntoClose=passing
SocketStreamTest>>testNextIntoCloseNonSignaling=passing
SocketStreamTest>>testUnCategorizedMethods=passing
SocketStreamTest>>testUpTo=passing
SocketStreamTest>>testUpToAfterCloseNonSignaling=passing
SocketStreamTest>>testUpToAfterCloseSignaling=passing
SocketStreamTest>>testUpToAll=passing
SocketStreamTest>>testUpToAllAfterCloseNonSignaling=passing
SocketStreamTest>>testUpToAllAfterCloseSignaling=passing
SocketStreamTest>>testUpToAllAsciiVsBinary=passing
SocketStreamTest>>testUpToAllCrlfAscii=passing
SocketStreamTest>>testUpToAllCrlfBinary=passing
SocketStreamTest>>testUpToAllCrlfCrlfAscii=passing
SocketStreamTest>>testUpToAllCrlfCrlfBinary=passing
SocketStreamTest>>testUpToAllEmptyPatternAscii=passing
SocketStreamTest>>testUpToAllEmptyPatternBinary=passing
SocketStreamTest>>testUpToAllLimit=passing
SocketStreamTest>>testUpToAllLongPatternAscii=passing
SocketStreamTest>>testUpToAllLongPatternBinary=passing
SocketStreamTest>>testUpToAllMediumPatternAscii=passing
SocketStreamTest>>testUpToAllMediumPatternBinary=passing
SocketStreamTest>>testUpToAllShortPatternAscii=passing
SocketStreamTest>>testUpToAllShortPatternAscii2=passing
SocketStreamTest>>testUpToAllShortPatternBinary=passing
SocketStreamTest>>testUpToAllShortPatternBinary2=passing
SocketStreamTest>>testUpToAllTimeout=passing
SocketStreamTest>>testUpToAsciiVsBinary=passing
SocketStreamTest>>testUpToEndClose=passing
SocketStreamTest>>testUpToEndCloseNonSignaling=passing
SocketStreamTest>>testUpToMax=passing
SocketStreamTest>>testUpToTimeout=passing
SocketTest>>testClientConnect=passing
SocketTest>>testDataReceive=passing
SocketTest>>testDataSending=passing
SocketTest>>testLocalAddress=passing
SocketTest>>testLocalPort=passing
SocketTest>>testPeerName=passing
SocketTest>>testReceiveTimeout=passing
SocketTest>>testRemoteAddress=passing
SocketTest>>testRemotePort=passing
SocketTest>>testSendTimeout=passing
SocketTest>>testServerAccept=passing

# In principal, socket options are implemented.
# However, the purpose of test remainder (involving 2 UDP sockets) remains unclear and does not
# even pass on OSVM. Second, StandardSocketOptions#SO_REUSEPORT is only available in Java 9+,
# so test failures on JDK 8 are possible.
SocketTest>>testSocketReuse=ignored
SocketTest>>testStringFromAddress=ignored
SocketTest>>testUDP=ignored

SocketTest>>testStringFromAddress=passing
SocketTest>>testUDP=passing
SortedCollectionTest>>testAdd=passing
SortedCollectionTest>>testAddAll=passing
SortedCollectionTest>>testAddAll2=passing
Expand Down Expand Up @@ -3654,10 +3660,7 @@ SqNumberParserTest>>testScaledDecimalWithTrailingZeroes=passing
SqNumberParserTest>>testUnCategorizedMethods=passing
SqueakSSLTest>>testConnectAccept=passing
SqueakSSLTest>>testEncryptDecrypt=passing

# Broken test? I cannot figure out why failure is expected.
# self shouldnt: [ webClient httpGet: 'https://graph.facebook.com' ]
SqueakSSLTest>>testFaceBookAPI=broken_in_squeak
SqueakSSLTest>>testFaceBookAPI=passing

# Broken test, or changed requirements from Google, and JDK dependent.
# On JDK 11, the response indicates that SNI has to be used, however, the test does not supply the server name.
Expand All @@ -3668,17 +3671,13 @@ SqueakSSLTest>>testGooglePopStream=broken_in_squeak

SqueakSSLTest>>testMultiFrameDecrypt=passing
SqueakSSLTest>>testSingleByteDecrypt=passing

# may depend on socket plugin stability
SqueakSSLTest>>testSocketAccept=ignored
SqueakSSLTest>>testSocketConnect=ignored
SqueakSSLTest>>testSplitTlsFrameRead=ignored
SqueakSSLTest>>testSSLSockets=ignored

SqueakSSLTest>>testStreamAccept=ignored
SqueakSSLTest>>testStreamConnect=ignored
SqueakSSLTest>>testStreamTransfer=ignored

SqueakSSLTest>>testSocketAccept=passing
SqueakSSLTest>>testSocketConnect=passing
SqueakSSLTest>>testSplitTlsFrameRead=passing
SqueakSSLTest>>testSSLSockets=passing
SqueakSSLTest>>testStreamAccept=passing
SqueakSSLTest>>testStreamConnect=passing
SqueakSSLTest>>testStreamTransfer=passing
ST80MenusTest>>testSupplyAnswerOfFillInTheBlank=passing
ST80MenusTest>>testSupplySpecificAnswerToQuestion=passing
ST80MenusTest>>testSuppressInform=passing
Expand Down Expand Up @@ -3717,9 +3716,9 @@ StopwatchTest>>testReset=passing
StopwatchTest>>testSingleTiming=passing
StopwatchTest>>testStartStop=passing
StopwatchTest>>testUnCategorizedMethods=passing
StringSocketTestCase>>testBasics=failing
StringSocketTestCase>>testBogusInput1=failing
StringSocketTestCase>>testBogusInput2=failing
StringSocketTestCase>>testBasics=passing
StringSocketTestCase>>testBogusInput1=passing
StringSocketTestCase>>testBogusInput2=passing
StringTest>>testAsCamelCase=passing
StringTest>>testAsDecomposedUnicode=passing
StringTest>>testAsInteger=passing
Expand Down Expand Up @@ -3837,7 +3836,10 @@ SUnitTest>>testResult=passing
SUnitTest>>testRunning=passing
SUnitTest>>testShould=passing
SUnitTest>>testSuite=passing
SUnitTest>>testTestTimeout=passing

# We dynamically adjust the test timeout for longer running tests.
SUnitTest>>testTestTimeout=ignored

SUnitTest>>testTestTimeoutLoop=not_terminating
SUnitTest>>testTestTimeoutTag=passing
SUnitTest>>testWithExceptionDo=passing
Expand Down Expand Up @@ -4774,76 +4776,79 @@ WeakSetTest>>testIncludes=passing
WeakSetTest>>testIncludesNil=passing
WeakSetTest>>testNew=passing
WeakSetTest>>testUnCategorizedMethods=passing
WebClientServerTest>>testArrays=flaky
WebClientServerTest>>testAuthException=flaky
WebClientServerTest>>testAuthRedirectSession=flaky
WebClientServerTest>>testBasicAuth=flaky
WebClientServerTest>>testBerarerAuth=flaky
WebClientServerTest>>testChunkedLoopback=flaky
WebClientServerTest>>testChunkedLoopbackWithStream=flaky
WebClientServerTest>>testChunkedRequest=flaky
WebClientServerTest>>testChunkedResponse=flaky
WebClientServerTest>>testContentEncodingGZip=flaky
WebClientServerTest>>testContentTypeCharsetEncoding=flaky
WebClientServerTest>>testCookieDomainRules=flaky
WebClientServerTest>>testCookieExpiryParsing=flaky
WebClientServerTest>>testCookieParsing=flaky
WebClientServerTest>>testCookies=flaky
WebClientServerTest>>testDecodeWebSocketKey=flaky
WebClientServerTest>>testDefault404=flaky
WebClientServerTest>>testDictionaries=flaky
WebClientServerTest>>testDigestAuth=flaky
WebClientServerTest>>testDuplicateCookies=flaky
WebClientServerTest>>testGetFields=flaky
WebClientServerTest>>testHmacSha1=flaky
WebClientServerTest>>testHtmlSubmit=flaky
WebClientServerTest>>testHttpDelete=flaky
WebClientServerTest>>testHttpHead=flaky
WebClientServerTest>>testHttpOptions=flaky
WebClientServerTest>>testHttpTrace=flaky
WebClientServerTest>>testInvalidCookies=flaky
WebClientServerTest>>testListenOnInterface=flaky
WebClientServerTest>>testLogging200=flaky
WebClientServerTest>>testLogging404=flaky
WebClientServerTest>>testMD5Digest=flaky
WebClientServerTest>>testMultipartFields=flaky
WebClientServerTest>>testMultipartFiles=flaky
WebClientServerTest>>testMultipartFiles2=flaky
WebClientServerTest>>testNestedAction=flaky
WebClientServerTest>>testNilTrueFalse=flaky
WebClientServerTest>>testNo302Redirect=flaky
WebClientServerTest>>testNumbers=flaky
WebClientServerTest>>testPersistentAuthRedirectSession=flaky
WebClientServerTest>>testPostFields=flaky
WebClientServerTest>>testRedirect=flaky
WebClientServerTest>>testRedirectLoop=flaky
WebClientServerTest>>testRedirectTrailingSlash=flaky
WebClientServerTest>>testResponseUrl=flaky
WebClientServerTest>>testSchemeHandling=flaky
WebClientServerTest>>testServerDestroy=flaky
WebClientServerTest>>testServerError=flaky
WebClientServerTest>>testServerNameAndPort=flaky
WebClientServerTest>>testServerRegistry=flaky
WebClientServerTest>>testSignOAuthGet=flaky
WebClientServerTest>>testSignOAuthGetDupFields=flaky
WebClientServerTest>>testSignOAuthGetFields=flaky
WebClientServerTest>>testSignOAuthPostFields=flaky
WebClientServerTest>>testSignOAuthUrlEncoding=flaky
WebClientServerTest>>testSimpleServerAction=flaky
WebClientServerTest>>testStreaming=flaky
WebClientServerTest>>testStrings=flaky
WebClientServerTest>>testTransientPostContent=flaky
WebClientServerTest>>testUrlEncoding=flaky
WebClientServerTest>>testWebSocketHash07=flaky
WebClientServerTest>>testWebSockets=flaky
WebClientServerTest>>testWebSockets00=flaky
WebClientServerTest>>testWebSockets07=flaky
WebClientServerTest>>testWebSockets07ControlDecode=flaky
WebClientServerTest>>testWebSockets07ControlInterleave=flaky
WebClientServerTest>>testWebSockets07DataDecode=flaky
WebClientServerTest>>testWebSockets07NoMask=flaky
WebClientServerTest>>testWebSockets68=flaky
WebClientServerTest>>testWebSocketsFraming=flaky

WebClientServerTest>>testArrays=slowly_passing
WebClientServerTest>>testAuthException=slowly_passing
WebClientServerTest>>testAuthRedirectSession=slowly_passing
WebClientServerTest>>testBasicAuth=slowly_passing
WebClientServerTest>>testBerarerAuth=slowly_passing
WebClientServerTest>>testChunkedLoopback=slowly_passing
WebClientServerTest>>testChunkedLoopbackWithStream=slowly_passing
WebClientServerTest>>testChunkedRequest=slowly_passing
WebClientServerTest>>testChunkedResponse=slowly_passing
WebClientServerTest>>testContentEncodingGZip=slowly_passing
WebClientServerTest>>testContentTypeCharsetEncoding=slowly_passing
WebClientServerTest>>testCookieDomainRules=slowly_passing
WebClientServerTest>>testCookieExpiryParsing=slowly_passing
WebClientServerTest>>testCookieParsing=slowly_passing
WebClientServerTest>>testCookies=slowly_passing
WebClientServerTest>>testDecodeWebSocketKey=slowly_passing
WebClientServerTest>>testDefault404=slowly_passing
WebClientServerTest>>testDictionaries=slowly_passing
WebClientServerTest>>testDigestAuth=slowly_passing
WebClientServerTest>>testDuplicateCookies=slowly_passing
WebClientServerTest>>testGetFields=slowly_passing
WebClientServerTest>>testHmacSha1=slowly_passing
WebClientServerTest>>testHtmlSubmit=slowly_passing
WebClientServerTest>>testHttpDelete=slowly_passing
WebClientServerTest>>testHttpHead=slowly_passing
WebClientServerTest>>testHttpOptions=slowly_passing
WebClientServerTest>>testHttpTrace=slowly_passing
WebClientServerTest>>testInvalidCookies=slowly_passing
WebClientServerTest>>testListenOnInterface=slowly_passing
WebClientServerTest>>testLogging200=slowly_passing
WebClientServerTest>>testLogging404=slowly_passing
WebClientServerTest>>testMD5Digest=slowly_passing
WebClientServerTest>>testMultipartFields=slowly_passing
WebClientServerTest>>testMultipartFiles=slowly_passing
WebClientServerTest>>testMultipartFiles2=slowly_passing
WebClientServerTest>>testNestedAction=slowly_passing
WebClientServerTest>>testNilTrueFalse=slowly_passing
WebClientServerTest>>testNo302Redirect=slowly_passing
WebClientServerTest>>testNumbers=slowly_passing
WebClientServerTest>>testPersistentAuthRedirectSession=slowly_passing
WebClientServerTest>>testPostFields=slowly_passing
WebClientServerTest>>testRedirect=slowly_passing
WebClientServerTest>>testRedirectLoop=slowly_passing
WebClientServerTest>>testRedirectTrailingSlash=slowly_passing
WebClientServerTest>>testResponseUrl=slowly_passing
WebClientServerTest>>testSchemeHandling=slowly_passing
WebClientServerTest>>testServerDestroy=slowly_passing
WebClientServerTest>>testServerError=slowly_passing
WebClientServerTest>>testServerNameAndPort=slowly_passing
WebClientServerTest>>testServerRegistry=slowly_passing
WebClientServerTest>>testSignOAuthGet=slowly_passing
WebClientServerTest>>testSignOAuthGetDupFields=slowly_passing
WebClientServerTest>>testSignOAuthGetFields=slowly_passing
WebClientServerTest>>testSignOAuthPostFields=slowly_passing
WebClientServerTest>>testSignOAuthUrlEncoding=slowly_passing
WebClientServerTest>>testSimpleServerAction=slowly_passing
WebClientServerTest>>testStreaming=slowly_passing
WebClientServerTest>>testStrings=slowly_passing
WebClientServerTest>>testTransientPostContent=slowly_passing
WebClientServerTest>>testUrlEncoding=slowly_passing

WebClientServerTest>>testWebSocketHash07=passing
WebClientServerTest>>testWebSockets=not_terminating
WebClientServerTest>>testWebSockets00=not_terminating
WebClientServerTest>>testWebSockets07=not_terminating
WebClientServerTest>>testWebSockets07ControlDecode=not_terminating
WebClientServerTest>>testWebSockets07ControlInterleave=not_terminating
WebClientServerTest>>testWebSockets07DataDecode=not_terminating
WebClientServerTest>>testWebSockets07NoMask=not_terminating
WebClientServerTest>>testWebSockets68=not_terminating
WebClientServerTest>>testWebSocketsFraming=not_terminating

WeekTest>>testClassComment=passing
WeekTest>>testCoverage=passing
WeekTest>>testDayNames=passing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,35 @@ public final long getReasonCode() {
}
}

/**
* Primitive failed.
*
* <p>
* Below factory methods return {@code PrimitiveFailed}, such that it is possible to substitue a
* return clause. Example:
* </p>
*
* <pre>
* <code>long getStatus() {
* try {
* return 0;
* } catch (final IOException e) {
* throw PrimitiveFailed.andTransferToInterpreter();
* // no unreachable return statement required.
* }
* }
* </code>
* </pre>
*/
public static final class PrimitiveFailed extends AbstractPrimitiveFailed {
private static final long serialVersionUID = 1L;

public static void andTransferToInterpreter() {
public static PrimitiveFailed andTransferToInterpreter() {
CompilerDirectives.transferToInterpreter();
throw new PrimitiveFailed();
}

public static void andTransferToInterpreter(final long reason) {
public static PrimitiveFailed andTransferToInterpreter(final long reason) {
CompilerDirectives.transferToInterpreter();
throw new PrimitiveFailed(reason);
}
Expand Down
Loading