Distributed Services With Go - Agent_test.go error line 77

This test is broken right out of the box…

— FAIL: TestAgent (7.82s)
agent_test.go:77:
Error Trace: agent_test.go:77
agent_test.go:116
Error: Received unexpected error:
FlushFileBuffers: The handle is invalid.
Test: TestAgent
testing.go:906: race detected during execution of test

2 Likes

What chapter? And you include the entire stacktrace?

1 Like

CHAPTER 6
Server-to-Server Service Discovery

Stacktrace:


=== RUN TestAgent

2020/06/23 18:10:36 [INFO] serf: EventMemberJoin: 0 127.0.0.1

2020/06/23 18:10:36 [INFO] serf: EventMemberJoin: 1 127.0.0.1

2020/06/23 18:10:36 [DEBUG] memberlist: Initiating push/pull sync with: 127.0.0.1:22289

2020/06/23 18:10:36 [DEBUG] memberlist: Stream connection from=127.0.0.1:58739

2020/06/23 18:10:36 [INFO] serf: EventMemberJoin: 0 127.0.0.1

2020/06/23 18:10:36 [INFO] serf: EventMemberJoin: 1 127.0.0.1

2020/06/23 18:10:36 [INFO] serf: EventMemberJoin: 2 127.0.0.1

2020/06/23 18:10:36 [DEBUG] memberlist: Initiating push/pull sync with: 127.0.0.1:22289

2020/06/23 18:10:36 [DEBUG] memberlist: Stream connection from=127.0.0.1:58743

2020/06/23 18:10:36 [INFO] serf: EventMemberJoin: 2 127.0.0.1

2020/06/23 18:10:36 [INFO] serf: EventMemberJoin: 1 127.0.0.1

2020/06/23 18:10:36 [INFO] serf: EventMemberJoin: 0 127.0.0.1

2020/06/23 18:10:36 [INFO] serf: EventMemberJoin: 2 127.0.0.1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 1

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:36 [DEBUG] serf: messageJoinType: 2

2020/06/23 18:10:39 [ERROR] proglog: rpc error: code = Unknown desc = unexpected EOF

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [INFO] serf: EventMemberLeave: 0 127.0.0.1

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [DEBUG] serf: messageLeaveType: 0

2020/06/23 18:10:42 [INFO] serf: EventMemberLeave: 0 127.0.0.1

2020/06/23 18:10:42 [INFO] serf: EventMemberLeave: 0 127.0.0.1

2020/06/23 18:10:44 [ERROR] proglog: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error:

TestAgent: agent_test.go:77: 

        Error Trace:    agent_test.go:77

                                    agent_test.go:116

        Error:          Received unexpected error:

                        FlushFileBuffers: The handle is invalid.

        Test:           TestAgent

— FAIL: TestAgent (8.03s)

FAIL

coverage: 83.1% of statements

FAIL github.com/travisjeffery/proglog/internal/agent 9.051s

FAIL


1 Like

You’re on Windows, right? Does any one get this and are they (you reading this) on Windows as well?

yes, I ran it on win10 x64 + go 1.14.

Interesting if this happening on this specific platform… so much for platform compatibility for golang if this is the case!

Can you close this: https://github.com/travisjeffery/proglog/tree/master/ServerSideServiceDiscovery and run the tests in the ServerSideServiceDiscovery directory. If they do pass, can you give me a recursive diff between your and this ServerSideServiceDiscovery directory. On Linux I’d do that with diff -r don’t know how you’d do that on Windows.

Hi again,

It still errors out in windows. However I ran the code on a linux vm, and it passed without problems…

Maybe you put a note in your book commenting that the code is proven to work only in unix like environments?

Yeah I’ll definitely mention it in the book. If I get a chance I’ll tinker with it on Windows as well. Or you ever find a fix I’d appreciate it.