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

Fix CI #1197

Merged
merged 21 commits into from
Mar 9, 2021
Merged

Fix CI #1197

merged 21 commits into from
Mar 9, 2021

Conversation

parsonsmatt
Copy link
Collaborator

Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Bumped the version number if there isn't an (unreleased) on the Changelog
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

@parsonsmatt
Copy link
Collaborator Author

CI is acting really weird.

We're consistently getting two failures with Postgres. The failure error message is bizarre:

Failures:

  src/MigrationTest.hs:41:5: 
  1) Migration is idempotent
       uncaught exception: IOException of type OtherError
       libpq: failed (server closed the connection unexpectedly
       	This probably means the server terminated abnormally
       	before or while processing the request.
       could not send SSL negotiation packet: Success
       )

  To rerun use: --match "/Migration/is idempotent/"

  test/PgIntervalTest.hs:37:5: 
  2) Postgres Interval Property tests Round trips
       uncaught exception: IOException of type OtherError
       libpq: failed (server closed the connection unexpectedly
       	This probably means the server terminated abnormally
       	before or while processing the request.
       could not send SSL negotiation packet: Success
       )
       (after 25 tests)
         15.333255892191s

could not send SSL negotiation packet: Success looks real fishy, and it points to an issue in libpq apparently. The cabal-based CI is building with postgresql-libpq-0.9.4.3, which has minimal dependencies. The last upload was 2020-11-02, and I don't think the CI failures started then. The only relevant dependnecy is unix, which hasn't seen an upload since 2017, so unlikely to be the problem. There have been upgrades to base made, but that's (unlikely?) to be a problem, since the issue occurs on GHC down to 8.6.

Doing a quick rg over the postgresql-libpq library, the string Success doesn't ever show up. There is a result status with this code:

-- | Returns the result status of the command.
resultStatus :: Result
             -> IO ExecStatus
resultStatus result = enumFromResult result c_PQresultStatus


-- | Converts the 'ExecStatus' returned by 'resultStatus' into a
-- string describing the status code. The caller should not
-- free the result.
resStatus :: ExecStatus
          -> IO B.ByteString
resStatus es =
    do cstr <- c_PQresStatus $ fromIntegral $ fromEnum es
       len <- B.c_strlen cstr
       fp <- newForeignPtr_ $ castPtr cstr
       return $ B.fromForeignPtr fp 0 $ fromIntegral len

We also don't have the string failed that appears in that error position. So I think the error is occurring below the Haskell code, in libpq itself. That's above my pay grade for now, so I'm going to assume it's a Docker or config or similar issue.

Possible work-around: implement a try/catch in runConn that retries on exception, and if the exception happens twice, then we rethrow.

@parsonsmatt parsonsmatt merged commit 38350b6 into master Mar 9, 2021
vapaj pushed a commit to KSF-Media/persistent that referenced this pull request Mar 10, 2021
* dummy

* Document testing facility

* add a smoke test

* temp disable matrix to speed up CI testing

* disable non pg stuff temporarily

* lol whoops

* hm

* no mysql

* hmm

* hm

* k

* is it just this one ???

* oops

* uh is it this one??

* groooooss

* restore tests

* use regular setup

* remove the try

* screaming

* restore entire suite

* -_-
@parsonsmatt parsonsmatt deleted the matt/fix-ci branch April 1, 2021 16:55
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

Successfully merging this pull request may close these issues.

None yet

1 participant