Skip to content

Instantly share code, notes, and snippets.

View wtask's full-sized avatar
🏠
Working from home

Mike Mikhailov wtask

🏠
Working from home
  • Tver, Russia
View GitHub Profile
@posener
posener / go-table-driven-tests-parallel.md
Last active April 30, 2024 20:34
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@snoyberg
snoyberg / README.md
Last active August 22, 2019 17:35
Docker testing of edge cases with containers

There are a number of corner cases to consider when dealing with Docker, multiple processes, and signals. Probably the most famous post on this matter is from the Phusion blog. Here, we'll see some examples of how to see these problems first hand, and one way to work around it.

The Phusion blog post recommends using their baseimage-docker. We ran into problems with Phusion's usage of syslog-ng, in particular with it creating