Comments (13)
I just pulled from master and ran the 0.0.3 release for windows. The following are the logs:
from Pact Daemon:
$ ./pact-go_windows_386.exe daemon -v -l DEBUG
2017/02/23 09:04:26 [DEBUG] setting up a service manager
2017/02/23 09:04:26 [DEBUG] setting up a service manager
2017/02/23 09:04:26 [DEBUG] setting up a service manager
2017/02/23 09:04:26 [DEBUG] setting up a service manager
2017/02/23 09:04:26 [INFO] daemon - starting daemon on network: tcp address: port: 6666
2017/02/23 09:04:26 method Shutdown has wrong number of ins: 1
2017/02/23 09:04:26 [DEBUG] starting service removal monitor
2017/02/23 09:04:26 method StartDaemon has wrong number of ins: 4
2017/02/23 09:04:26 [DEBUG] starting service creation monitor
2017/02/23 09:04:26 [DEBUG] starting service creation monitor
2017/02/23 09:04:26 [DEBUG] starting service removal monitor
2017/02/23 09:04:26 [DEBUG] starting service creation monitor
2017/02/23 09:04:26 [DEBUG] starting service creation monitor
2017/02/23 09:04:26 [DEBUG] starting service removal monitor
2017/02/23 09:04:26 [DEBUG] starting service removal monitor
2017/02/23 09:04:30 [DEBUG] daemon - starting mock server with args: [--pact-specification-version 2 --pact-dir C:\MYPATH\Projects\Go\src\github.com\pact-foundation\pact-go\examples\pacts --log C:\MYPATH\Projects\Go\src\github.com\pact-foundation\pact-go\examples\logs\pact.log --consumer MyConsumer --provider MyProvider]
2017/02/23 09:04:30 [DEBUG] starting mock service on port: 55267
2017/02/23 09:04:30 [DEBUG] starting service
2017/02/23 09:04:30 [INFO] service: [2017-02-23 09:04:30] INFO WEBrick 1.3.1
2017/02/23 09:04:30 [INFO] service: [2017-02-23 09:04:30] INFO ruby 2.1.5 (2014-11-13) [i386-mingw32]
2017/02/23 09:04:30 [INFO] service: [2017-02-23 09:04:30] INFO WEBrick::HTTPServer#start: pid=10800 port=55267
2017/02/23 09:04:31 [DEBUG] daemon - stopping mock server
2017/02/23 09:04:31 [DEBUG] stopping service with pid 10280
2017/02/23 09:04:34 [INFO] service: [2017-02-23 09:04:34] ERROR Errno::ECONNRESET: An existing connection was forcibly closed by the remote host. @ io_fillbuf - fd:7
2017/02/23 09:04:34 [INFO] service: C:/MYPATH/pact-mock-service/lib/vendor/ruby/2.1.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:80:in `eof?'
2017/02/23 09:04:34 [INFO] service: C:/MYPATH/pact-mock-service/lib/vendor/ruby/2.1.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:80:in `run'
2017/02/23 09:04:34 [INFO] service: C:/MYPATH/pact-mock-service/lib/vendor/ruby/2.1.0/gems/webrick-1.3.1/lib/webrick/server.rb:191:in `block in start_thread'
2017/02/23 09:04:34 [INFO] service: [2017-02-23 09:04:34] ERROR Errno::ECONNRESET: An existing connection was forcibly closed by the remote host. @ io_fillbuf - fd:8
2017/02/23 09:04:34 [INFO] service: C:/MYPATH/pact-mock-service/lib/vendor/ruby/2.1.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:80:in `eof?'
2017/02/23 09:04:34 [INFO] service: C:/MYPATH/pact-mock-service/lib/vendor/ruby/2.1.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:80:in `run'
2017/02/23 09:04:34 [INFO] service: C:/MYPATH/pact-mock-service/lib/vendor/ruby/2.1.0/gems/webrick-1.3.1/lib/webrick/server.rb:191:in `block in start_thread'
2017/02/23 09:04:34 [INFO] service: [2017-02-23 09:04:34] ERROR Errno::ECONNRESET: An existing connection was forcibly closed by the remote host. @ io_fillbuf - fd:6
2017/02/23 09:04:34 [INFO] service: C:/MYPATH/pact-mock-service/lib/vendor/ruby/2.1.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:80:in `eof?'
2017/02/23 09:04:34 [INFO] service: C:/MYPATH/pact-mock-service/lib/vendor/ruby/2.1.0/gems/webrick-1.3.1/lib/webrick/httpserver.rb:80:in `run'
2017/02/23 09:04:34 [INFO] service: C:/MYPATH/pact-mock-service/lib/vendor/ruby/2.1.0/gems/webrick-1.3.1/lib/webrick/server.rb:191:in `block in start_thread'
And from the consumer example:
2017/02/23 09:04:30 [DEBUG] pact setup logging
2017/02/23 09:04:30 [DEBUG] pact setup
2017/02/23 09:04:30 [DEBUG] client: starting a server
2017/02/23 09:04:30 [DEBUG] creating an HTTP client
2017/02/23 09:04:30 [DEBUG] waiting for port 6666 to become available
2017/02/23 09:04:30 [DEBUG] waiting for port 55267 to become available
2017/02/23 09:04:31 [DEBUG] pact add interaction
2017/02/23 09:04:31 [DEBUG] pact setup logging
2017/02/23 09:04:31 [DEBUG] pact setup
2017/02/23 09:04:31 [DEBUG] pact add interaction
2017/02/23 09:04:31 [DEBUG] pact setup logging
2017/02/23 09:04:31 [DEBUG] pact setup
2017/02/23 09:04:31 [DEBUG] pact verify
2017/02/23 09:04:31 [DEBUG] mock service add interaction
2017/02/23 09:04:31 [DEBUG] mock service response Body: Set interactions
2017/02/23 09:04:31 [DEBUG] mock service add interaction
2017/02/23 09:04:31 [DEBUG] mock service response Body: Set interactions
2017/02/23 09:04:31 [DEBUG] mock service verify
2017/02/23 09:04:31 [DEBUG] mock service response Body: Interactions matched
2017/02/23 09:04:31 [DEBUG] mock service delete interactions
2017/02/23 09:04:31 [DEBUG] mock service response Body: Deleted interactions
Test Passed!
2017/02/23 09:04:31 [DEBUG] teardown
2017/02/23 09:04:31 [DEBUG] client: stop server
2017/02/23 09:04:31 [DEBUG] creating an HTTP client
2017/02/23 09:04:31 [DEBUG] waiting for port 6666 to become available
Seems to be working.
from pact-go.
Is there a Vagrant VM you're using for this perchance?
from pact-go.
This was run on Windows 10 Pro with VMWare Fusion.
from pact-go.
On Windows 10 Home (not emulated), I also get this error:
Tony@Home ~/Projects/go/src/github.com/pact-foundation/pact-go/examples (master)
$ ./consumer.exe
2017/02/09 19:03:09 Error on Verify: Post http://localhost:0/interactions: dial tcp [::1]:0: connectex: The requested address is not valid in its context.
The Pact daemon is running on 6666.
from pact-go.
I'm wondering if perhaps the log path is the issue: H:\\pact-workshop\\pact-go-consumer\\logs/pact.log
, note the forward slash in the path.
Looks like the default path for the log file is set at https://github.com/pact-foundation/pact-go/blob/master/dsl/pact.go#L90, and includes a '/' which is probably not portable (I'll fix that if it turns out it's the issue).
Could you please try manually setting the path and seeing if that helps?
from pact-go.
- First i modified
client.go
and changed the Dial and DialHTTP to point tolocalhost
so that it could connect to the Daemon. - Modified the
consumer.go
file to use DEBUG log level - Modified
pact.go
and manually specified log file with:
if p.Server == nil {
p.LogDir = filepath.FromSlash("C:/Users/Tony/Projects/Go/src/github.com/pact-foundation/pact-go/examples/log/pact.log")
args := []string{
fmt.Sprintf("--pact-specification-version %d", p.SpecificationVersion),
fmt.Sprintf("--pact-dir %s", p.PactDir),
fmt.Sprintf("--log %s", p.LogDir),
fmt.Sprintf("--consumer %s", p.Consumer),
fmt.Sprintf("--provider %s", p.Provider),
}
client := &PactClient{Port: p.Port}
p.pactClient = client
fmt.Println("ARGUMENTS ARE:", args)
p.Server = client.StartServer(args)
}
Also printed out the arguments to see what they were:
2017/02/13 11:01:27 [DEBUG] pact setup logging
2017/02/13 11:01:27 [DEBUG] pact setup
ARGUMENTS ARE: [--pact-specification-version 2 --pact-dir C:\Users\Tony\Projects\go\src\github.com\pact-foundation\pact-go\examples\pacts --log C:\Users\Tony\Projects\Go\src\github.com\pact-foundation\pact-go\examples\log\pact.log --consumer MyConsumer --provider MyProvider]
2017/02/13 11:01:27 [DEBUG] client: starting a server
2017/02/13 11:01:27 [DEBUG] creating an HTTP client
2017/02/13 11:01:27 [DEBUG] waiting for port 6666 to become available
2017/02/13 11:01:27 [DEBUG] waiting for port 58166 to become available
2017/02/13 11:01:29 [ERROR] Expected server to start < 1s. Timed out waiting for Mock Server to
start on port 58166 - are you sure it's running?
2017/02/13 11:01:29 [DEBUG] pact add interaction
2017/02/13 11:01:29 [DEBUG] pact setup logging
2017/02/13 11:01:29 [DEBUG] pact setup
2017/02/13 11:01:29 [DEBUG] pact add interaction
2017/02/13 11:01:29 [DEBUG] pact setup logging
2017/02/13 11:01:29 [DEBUG] pact setup
2017/02/13 11:01:29 [DEBUG] pact verify
2017/02/13 11:01:29 [DEBUG] mock service add interaction
2017/02/13 11:01:31 Error on Verify: Post http://localhost:58166/interactions: dial tcp [::1]:58166: connectex: No connection could be made because the target machine actively refused it.
Daemon was run with --logLevel DEBUG:
$ ./pact-go_windows_386.exe daemon --logLevel DEBUG
2017/02/13 11:01:21 [DEBUG] setting up a service manager
2017/02/13 11:01:21 [DEBUG] setting up a service manager
2017/02/13 11:01:21 [DEBUG] setting up a service manager
2017/02/13 11:01:21 [DEBUG] setting up a service manager
2017/02/13 11:01:21 [INFO] daemon - starting daemon on port 6666
2017/02/13 11:01:21 [DEBUG] starting service removal monitor
2017/02/13 11:01:21 [DEBUG] starting service creation monitor
2017/02/13 11:01:21 [DEBUG] starting service removal monitor
2017/02/13 11:01:21 [DEBUG] starting service creation monitor
2017/02/13 11:01:21 [DEBUG] starting service creation monitor
2017/02/13 11:01:21 [DEBUG] starting service removal monitor
2017/02/13 11:01:21 method Shutdown has wrong number of ins: 1
2017/02/13 11:01:21 method StartDaemon has wrong number of ins: 2
2017/02/13 11:01:21 [DEBUG] starting service removal monitor
2017/02/13 11:01:21 [DEBUG] starting service creation monitor
2017/02/13 11:01:27 [DEBUG] daemon - starting mock server
2017/02/13 11:01:27 [DEBUG] starting mock service on port: 58166
2017/02/13 11:01:27 [DEBUG] starting service
2017/02/13 11:01:28 [INFO] service: ERROR: "pact-mock-service.rb service" was called with arguments ["--port 58166", "--pact-specification-version 2", "--pact-dir C:\\Users\\Tony\\Projects\\go\\src\\github.com\\pact-foundation\\pact-go\\examples\\pacts", "--log C:\\Users\\Tony\\Projects\\go\\src\\github.com\\pact-foundation\\pact-go\\examples\\log\\pact.log", "--consumer MyConsumer", "--provider MyProvider"]
2017/02/13 11:01:28 [INFO] service: Usage: "pact-mock-service.rb service"
from pact-go.
Thanks for this @serinth! Might be an issue with the latest mock service or how we provide the arguments to it, I'll dig into it.
Out of interest, can you run the mock service independently of Pact Go? e.g. <path to pact-go>\pact-mock-service\bin\pact-mock-service <args>
?
from pact-go.
Have verified this issue locally.
from pact-go.
Update. With your client updates above and also modifying the flags sent to the Ruby Mock Service I have been able to get a successful test case running examples/consumer.go
.
The flags must be sent individually, rather than as key-pair combinations (e.g. https://github.com/pact-foundation/pact-go/blob/master/dsl/pact.go#L88-L92) .
I'll continue to look into it this week and find a solution that works nicely for both Windows and non-Windows clients.
from pact-go.
OK, I just have one remaining issue. When the tests complete, the connection to the Ruby service seems to remain open. The interrupt signal is being received, but Ruby doesn't want to shut down. Need to track down why there is a connection, but I have managed to create a workaround which I'll publish shortly to this branch.
from pact-go.
I've pushed a package that I've tested on a local Windows VM (Windows 11, 64bit).
Could you please check it out? (v0.0.3)
from pact-go.
It seems due to the naming of my branch that was merged closed the ticket - reopening until you can confirm.
from pact-go.
Great - sorry about the logs though - eww!
I'm looking into the underlying cause of the connection not closing (this work was probably required anyway). I'll close this for now and re-open another ticket to resolve the logging situation.
from pact-go.
Related Issues (20)
- Is PactFileWriteMode no longer available? HOT 1
- Metadata information not getting recorded for protobuf-message HOT 1
- Protobuf cannot find enum with multiple proto files HOT 3
- requestMetadata expects exact value instead of matching type
- How to specify Pact CLI path in Go package manager HOT 7
- Add support for disabling colored output HOT 8
- Library not loaded: libpact_ffi.dylib HOT 22
- VerifyMessageConsumer failed: error creating message: exit status 255 HOT 1
- undefined structs running pact-go/v2 HOT 3
- BeforeEach method runs before every state HOT 6
- Why is there a functional pattern constructore for the installer? HOT 1
- Runtime error occurs with golang 1.22.x HOT 8
- Installation section of README.md is the wrong path HOT 1
- Current state of the go implementation and roadmap HOT 8
- "example=0" struct tags for numbers lead to wrong example values in contract HOT 1
- New release? HOT 5
- Incorrect header matching rules key in v2 pact files
- Provider Verification - parse header error coming from pact-ffi HOT 2
- RFC: stop supporting GoLang 1.20 HOT 2
- Verify Pact-Go against pact-compatibility-suite
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pact-go.