Skip to content

Commit

Permalink
fix: use Started instead of listening (#167)
Browse files Browse the repository at this point in the history
* fix: use Started instead of listening

To avoid breaking existing clients of Ryuk, using a custom Ryuk version with older testcontainers versions.

* fix: update tests

* chor: better message

* docs: fix

* fix: simplify message
  • Loading branch information
mdelapenya authored Oct 10, 2024
1 parent a1f6d78 commit 91122e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ In the ryuk window you'll see containers/networks/volumes deleted after 10s

```log
time=2024-09-30T19:42:30.000+01:00 level=INFO msg=starting connection_timeout=1m0s reconnection_timeout=10s request_timeout=10s shutdown_timeout=10m0s remove_retries=10 retry_offset=-1s port=8080 verbose=false
time=2024-09-30T19:42:30.001+01:00 level=INFO msg=listening address=[::]:8080
time=2024-09-30T19:42:30.001+01:00 level=INFO msg="Started"
time=2024-09-30T19:42:30.001+01:00 level=INFO msg="client processing started"
time=2024-09-30T19:42:38.002+01:00 level=INFO msg="client connected" address=127.0.0.1:56432 clients=1
time=2024-09-30T19:42:38.002+01:00 level=INFO msg="adding filter" type=label values="[testing=true testing.sessionid=mysession]"
Expand Down
4 changes: 3 additions & 1 deletion reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ func newReaper(ctx context.Context, options ...reaperOption) (*reaper, error) {
return nil, fmt.Errorf("listen: %w", err)
}

r.logger.Info("listening", fieldAddress, r.listener.Addr().String())
// This log message, in uppercase, is in use in different Testcontainers libraries,
// so it is important to keep it as is to not break the current behavior of the libraries.
r.logger.Info("Started", fieldAddress, r.listener.Addr().String())

return r, nil
}
Expand Down
2 changes: 1 addition & 1 deletion reaper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func testReaperRun(t *testing.T, tc *runTest) (string, error) {

// Standard checks for basic functionality.
log := buf.String()
require.Contains(t, log, "listening address="+addr)
require.Contains(t, log, "Started")
require.Contains(t, log, "client connected")
require.Contains(t, log, "adding filter")

Expand Down

0 comments on commit 91122e2

Please sign in to comment.