elesq
Distributed Services with Go: 'make tests' fails on testProduceConsume (code matches at this stage) page 132
@travisjeffery
As per instructions up to page 132, I have checked the code against the downloadable resources and A/B’d back and forth. Everything appears to be in good shape. At this point, it tells me to update the NewGRPCServer function and then I can run make test and everything will pass as before. Unfortunately, the tests are failing.
make test
go test -race ./...
? github.com/myusername/proglog/api/v1 [no test files]
? github.com/myusername/proglog/cmd/server [no test files]
? github.com/myusername/proglog/internal/config [no test files]
ok github.com/myusername/proglog/internal/log (cached)
--- FAIL: TestServer (0.00s)
--- FAIL: TestServer/produce/consume_a_message_to/from_the_log_succeeds (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x17a26a3]
goroutine 20 [running]:
testing.tRunner.func1.2(0x1817ae0, 0x1ccd540)
/usr/local/Cellar/go/1.16.6/libexec/src/testing/testing.go:1143 +0x49f
testing.tRunner.func1(0xc000082d80)
/usr/local/Cellar/go/1.16.6/libexec/src/testing/testing.go:1146 +0x695
panic(0x1817ae0, 0x1ccd540)
/usr/local/Cellar/go/1.16.6/libexec/src/runtime/panic.go:971 +0x499
github.com/elesq/proglog/internal/server.testProduceConsume(0xc000082d80, 0x0, 0x0, 0xc00017e530)
/Users/ed/code/myusername/go/book-distributed-services-with-go/proglog/internal/server/server_test.go:107 +0x1e3
github.com/myusername/proglog/internal/server.TestServer.func1(0xc000082d80)
/Users/ed/code/myusername/go/book-distributed-services-with-go/proglog/internal/server/server_test.go:34 +0x118
testing.tRunner(0xc000082d80, 0xc00009bcf0)
/usr/local/Cellar/go/1.16.6/libexec/src/testing/testing.go:1193 +0x203
created by testing.(*T).Run
/usr/local/Cellar/go/1.16.6/libexec/src/testing/testing.go:1238 +0x5d8
FAIL github.com/myusername/proglog/internal/server 0.482s
FAIL
make: *** [test] Error 1
Check the testcase shows my code is the same as the book and repo. Any ideas?
serve_test.go:107
produce, err := client.Produce(
ctx,
&api.ProduceRequest{
Record: want,
},
)
require.NoError(t, err)
and server_test:34
t.Run(scenario, func(t *testing.T) {
client,
config,
teardown := setupTest(t, nil)
defer teardown()
fn(t, client, config) // this is line 34
})
Cheers
Popular Pragmatic Bookshelf topics
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online:
p. 186 But...
New
Hi Brian,
Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list)
Typo:...
New
Hello Brian,
I have some problems with running the code in your book. I like the style of the book very much and I have learnt a lot as...
New
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here.
...
New
Hi @venkats,
It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New
I ran this command after installing the sample application:
$ cards add do something --owner Brian
And got a file not found error:
Fil...
New
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64)
If you follow the defau...
New
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1:
programming_ML/code/03_...
New
Other popular topics
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
Saw this on TikTok of all places! :lol:
Anyone heard of them before?
Lite:
New
If you want a quick and easy way to block any website on your Mac using Little Snitch simply…
File > New Rule:
And select Deny, O...
New
Author Spotlight:
Peter Ullrich
@PJUllrich
Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
Will Swifties’ war on AI fakes spark a deepfake porn reckoning?
New
I’m able to do the “artistic” part of game-development; character designing/modeling, music, environment modeling, etc.
However, I don’t...
New
Explore the power of Ash Framework by modeling and building the domain for a real-world web application.
Rebecca Le @sevenseacat and ...
New
This is a very quick guide, you just need to:
Download LM Studio: https://lmstudio.ai/
Click on search
Type DeepSeek, then select the o...
New
Node.js v22.14.0 has been released.
Link: Release 2025-02-11, Version 22.14.0 'Jod' (LTS), @aduh95 · nodejs/node · GitHub
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /python
- /js
- /rails
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /flutter
- /elm
- /vscode
- /ash
- /html
- /opensuse
- /centos
- /php
- /deepseek
- /zig
- /scala
- /lisp
- /textmate
- /sublime-text
- /react-native
- /nixos
- /debian
- /agda
- /kubuntu
- /arch-linux
- /deno
- /django
- /revery
- /ubuntu
- /spring
- /manjaro
- /nodejs
- /diversity
- /lua
- /julia
- /slackware
- /c







