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

Failure in upload integration tests on Mac #4191

Closed
Blaisorblade opened this issue Jul 29, 2018 · 5 comments
Closed

Failure in upload integration tests on Mac #4191

Blaisorblade opened this issue Jul 29, 2018 · 5 comments

Comments

@Blaisorblade
Copy link
Collaborator

Blaisorblade commented Jul 29, 2018

The upload integration test runs into network problems on my Mac, both via stack build --flag stack:integration-tests --test stack:stack-integration-test and by running the test directly.
I've seen the error on top of #4190 and I'm retesting on master (78762f9), but that PR shouldn't affect this test (testing).

The key error is

FakeHackage.hs: Network.Socket.listen: unsupported operation (Operation not supported on socket)

pgiarrusso@SilenceOfTheLambdas:~/git/stack/test/integration/tests/upload/files$ STACK_ROOT=~/.stack stack runghc -- -i../../../lib ../Main.hs
Running: /Users/pgiarrusso/.local/bin/stack runghc --package network FakeHackageStart.hs
FakeHackage.hs: Network.Socket.listen: unsupported operation (Operation not supported on socket)
Running: /Users/pgiarrusso/.local/bin/stack upload --no-signature .
Getting file list for /Users/pgiarrusso/git/stack/test/integration/tests/upload/files/
Building sdist tarball for /Users/pgiarrusso/git/stack/test/integration/tests/upload/files/
Checking package 'uploadtest' for common mistakes
Package check reported the following warnings:
A 'license-file' is not specified.
HttpExceptionRequest Request {
  host                 = "localhost"
  port                 = 12415
  secure               = False
  requestHeaders       = [("Content-Type","multipart/form-data; boundary=----WebKitFormBoundaryLE7kiuvdKFd78u1L"),("Accept","text/plain")]
  path                 = "/packages/"
  queryString          = ""
  method               = "POST"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.connect: <socket: 15>: does not exist (Connection refused))
Main.hs: Exited with exit code: ExitFailure 1
CallStack (from HasCallStack):
  error, called at ../../../lib/StackTest.hs:38:34 in main:StackTest
FakeHackage.hs: FakeHackage.hs: signal: 15

From the bigger test suite:

tackage-3185-ignore-bounds-in-snapshot
upload FAILED [1]

Failures:

  test/integration/IntegrationSpec.hs:77:
  1) upload
       uncaught exception: TestFailure (Exited with ExitFailure 1

       stdout:


       stderr:
       Running: /Users/pgiarrusso/git/stack/.stack-work/install/x86_64-osx/lts-11.6/8.2.2/bin/stack runghc --package network FakeHackageStart.hs
       Downloading lts-11.6 build plan ...
       Downloaded lts-11.6 build plan.
       Populating index cache ...
       Populated index cache.
       [1 of 2] Compiling Main             ( /private/var/folders/kb/bmw9vpm93vl3d5tyc15v8rp40000gn/T/stackhome72226/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /private/var/folders/kb/bmw9vpm93vl3d5tyc15v8rp40000gn/T/stackhome72226/.stack/setup-exe-src/setup-mPHDZzAJ.o )
       [2 of 2] Compiling StackSetupShim   ( /private/var/folders/kb/bmw9vpm93vl3d5tyc15v8rp40000gn/T/stackhome72226/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /private/var/folders/kb/bmw9vpm93vl3d5tyc15v8rp40000gn/T/stackhome72226/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
       Linking /private/var/folders/kb/bmw9vpm93vl3d5tyc15v8rp40000gn/T/stackhome72226/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 ...
       network-2.6.3.5: download
       network-2.6.3.5: configure
       network-2.6.3.5: build
       network-2.6.3.5: copy/register
       FakeHackage.hs: Network.Socket.listen: unsupported operation (Operation not supported on socket)
       Running: /Users/pgiarrusso/git/stack/.stack-work/install/x86_64-osx/lts-11.6/8.2.2/bin/stack upload --no-signature .
       Getting file list for /private/var/folders/kb/bmw9vpm93vl3d5tyc15v8rp40000gn/T/stack-integration-upload72226/
       Building sdist tarball for /private/var/folders/kb/bmw9vpm93vl3d5tyc15v8rp40000gn/T/stack-integration-upload72226/
       Checking package 'uploadtest' for common mistakes
       Package check reported the following warnings:
       A 'license-file' is not specified.
       HttpExceptionRequest Request {
         host                 = "localhost"
         port                 = 12415
         secure               = False
         requestHeaders       = [("Content-Type","multipart/form-data; boundary=----WebKitFormBoundaryOwwAXgKTTaY2ZyTc"),("Accept","text/plain")]
         path                 = "/packages/"
         queryString          = ""
         method               = "POST"
         proxy                = Nothing
         rawBody              = False
         redirectCount        = 10
         responseTimeout      = ResponseTimeoutDefault
         requestVersion       = HTTP/1.1
       }
        (ConnectionFailure Network.Socket.connect: <socket: 14>: does not exist (Connection refused))
       Main.hs: Exited with exit code: ExitFailure 1
       CallStack (from HasCallStack):
         error, called at /Users/pgiarrusso/git/stack/test/integration/lib/StackTest.hs:38:34 in main:StackTest
       FakeHackage.hs: FakeHackage.hs: signal: 15
       )

Randomized with seed 1221456671
@Blaisorblade
Copy link
Collaborator Author

Reproduced on master, with essentially the same log AFAICS.

giarrusso@SilenceOfTheLambdas:~/git/stack/test/integration/tests/upload/files$ STACK_ROOT=~/.stack stack runghc -- -i../../../lib ../Main.hs --verbose
Running: /Users/pgiarrusso/.local/bin/stack runghc --package network FakeHackageStart.hs
FakeHackage.hs: Network.Socket.listen: unsupported operation (Operation not supported on socket)
Running: /Users/pgiarrusso/.local/bin/stack upload --no-signature .
Getting file list for /Users/pgiarrusso/git/stack/test/integration/tests/upload/files/
Building sdist tarball for /Users/pgiarrusso/git/stack/test/integration/tests/upload/files/
Checking package 'uploadtest' for common mistakes
Package check reported the following warnings:
A 'license-file' is not specified.
HttpExceptionRequest Request {
  host                 = "localhost"
  port                 = 12415
  secure               = False
  requestHeaders       = [("Content-Type","multipart/form-data; boundary=----WebKitFormBoundaryDtO05EpPkazJNuuu"),("Accept","text/plain")]
  path                 = "/packages/"
  queryString          = ""
  method               = "POST"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.connect: <socket: 15>: does not exist (Connection refused))
Main.hs: Exited with exit code: ExitFailure 1
CallStack (from HasCallStack):
  error, called at ../../../lib/StackTest.hs:38:34 in main:StackTest
FakeHackage.hs: FakeHackage.hs: signal: 15

@Blaisorblade
Copy link
Collaborator Author

Fixing a likely typo makes the test progress more, not sure if this is success or a failure, and gotta look into my gpg setup. Patch:

diff --git a/test/integration/tests/upload/files/FakeHackage.hs b/test/integration/tests/upload/files/FakeHackage.hs
index 825e8ad7..eef4b934 100644
--- a/test/integration/tests/upload/files/FakeHackage.hs
+++ b/test/integration/tests/upload/files/FakeHackage.hs
@@ -18,7 +18,7 @@ main =
 serve :: IO ()
 serve = do
     let hints = defaultHints {addrFlags = [AI_PASSIVE], addrSocketType = Stream}
-    (addr:_) <- getAddrInfo Nothing Nothing (Just "12415")
+    (addr:_) <- getAddrInfo (Just hints) Nothing (Just "12415")
     sock <- socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)
     setSocketOption sock ReuseAddr 1
     bind sock (addrAddress addr)

Output:

~/git/stack/test/integration/tests/upload/files$ STACK_ROOT=~/.stack stack runghc -- -i../../../lib ../Main.hs --verbose
Running: /Users/pgiarrusso/.local/bin/stack runghc --package network FakeHackageStart.hs
Running: /Users/pgiarrusso/.local/bin/stack upload --no-signature .
Getting file list for /Users/pgiarrusso/git/stack/test/integration/tests/upload/files/
Building sdist tarball for /Users/pgiarrusso/git/stack/test/integration/tests/upload/files/
Checking package 'uploadtest' for common mistakes
Package check reported the following warnings:
A 'license-file' is not specified.
WARNING: No HTTP digest prompt found, this will probably fail
Unable to submit digest credentials due to: received unexpected status code.

Request: Request {
  host                 = "localhost"
  port                 = 12415
  secure               = False
  requestHeaders       = [("Content-Type","multipart/form-data; boundary=----WebKitFormBoundaryVYa0L0EGCKQQS7Bx"),("Accept","text/plain")]
  path                 = "/packages/"
  queryString          = ""
  method               = "POST"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
.

Response: Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Content-Length","1"),("Content-Type","text/plain")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
Uploading uploadtest-0.0.0.tar.gz... done!
Running: /Users/pgiarrusso/.local/bin/stack upload .
Getting file list for /Users/pgiarrusso/git/stack/test/integration/tests/upload/files/
Building sdist tarball for /Users/pgiarrusso/git/stack/test/integration/tests/upload/files/
Checking package 'uploadtest' for common mistakes
Package check reported the following warnings:
A 'license-file' is not specified.
WARNING: No HTTP digest prompt found, this will probably fail
Unable to submit digest credentials due to: received unexpected status code.

Request: Request {
  host                 = "localhost"
  port                 = 12415
  secure               = False
  requestHeaders       = [("Content-Type","multipart/form-data; boundary=----WebKitFormBoundaryhN4orVAB8qWzIJ2J"),("Accept","text/plain")]
  path                 = "/packages/"
  queryString          = ""
  method               = "POST"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
.

Response: Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Content-Length","1"),("Content-Type","text/plain")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
Uploading uploadtest-0.0.0.tar.gz... done!
Environment variable GPG_TTY is not set (see `man gpg-agent`)
Error signing with GPG
Should not be used!

FakeHackage.hs: FakeHackage.hs: signal: 15
pgiarrusso@SilenceOfTheLambdas:~/git/stack/test/integration/tests/upload/files$ echo $?
0

@koterpillar
Copy link
Contributor

The gpg output is expected - the test is substituted an always failing script named gpg.

@mihaimaruseac
Copy link
Contributor

Awesome, then we'll close this once we have reports of the test passing on all 3 major systems. Thanks

@mihaimaruseac
Copy link
Contributor

Reported passes on all three OSes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants