pact-foundation / pact-mock_service

Provides a mock service for use with Pact
https://pact.io
MIT License
72 stars 68 forks source link

Ruby 2.7 cannot load such file -- thwait #115

Closed mtchavez closed 4 years ago

mtchavez commented 4 years ago
Info Value
gem version 3.2.0
ruby version 2.7.0

What

Ruby 2.7 has removed several standard library components and replaced them with gems. One of those is thwait which is being used in this gem.

Suggested Fix

Notes

maneframe commented 4 years ago

Does thwait still need to be required at all? I don't see any obvious references to ThreadsWait anywhere...

mtchavez commented 4 years ago

Very good point. Now that you bring it up, I searched the git history and it appears to have been cargo-culted and just worked ™ because it was bundled with Ruby before 2.7. Can a maintainer confirm this is the case and we can remove it entirely? Good catch @maneframe

bethesque commented 4 years ago

Have you got a link to a build with the actual error?

mtchavez commented 4 years ago

I am not clear how you want people to contribute these sorts of things so I made a pull request #116 adding 2.7 to the build matrix to show the failure. It is really just using 2.7 and running the tests as the pull request description suggests. Failure: https://travis-ci.org/pact-foundation/pact-mock_service/jobs/635004086

bethesque commented 4 years ago

What happens if you remove the require 'thwait' line?

mtchavez commented 4 years ago

I would love to do something like that if the dependency isn't needed. Just need a maintainer to make a decision on that.

bethesque commented 4 years ago

The pact-mock_service maintainer? That's me. I've just deleted the require locally, and it doesn't cause any immediately apparent errors, but I'm not sure if that particular piece of code has a test in this code base. The mock service code was pulled out of a single "monolith" pact gem years ago, so the tests that execute it might actually be in the pact gem, because it's only the Pact gem that uses the AppManager.

When I remove the thwait require, I then get a heap of keyword argument errors for webmock.

bethesque commented 4 years ago

Not that the thwait gem has anything to do with it - just saying, there's a next level of errors after the thwait issue!

bethesque commented 4 years ago

I've deleted the require, it all seems to work ok.