Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Fix "log.SetLogger(...) was never called" warning #5095

Closed
wants to merge 2 commits into from

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Sep 26, 2023

Motivation

System tests sometimes complain with a warning about this issue:

[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.
Detected at:
	>  goroutine 89 [running]:
	>  runtime/debug.Stack()
	>  	/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
	>  sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
	>  	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/log/log.go:60 +0xcd
	>  sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithName(0xc0001f3400, {0x1d7b101, 0x14})
	>  	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/log/deleg.go:147 +0x45
	>  github.com/go-logr/logr.Logger.WithName({{0x201aac0, 0xc0001f3400}, 0x0}, {0x1d7b101?, 0x1d63709?})
	>  	/go/pkg/mod/github.com/go-logr/logr@v1.2.4/logr.go:336 +0x3d
	>  sigs.k8s.io/controller-runtime/pkg/client.newClient(0x1d09720?, {0x0, 0xc003dfa3f0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0})
	>  	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/client/client.go:122 +0xec
	>  sigs.k8s.io/controller-runtime/pkg/client.New(0x20024e0?, {0x0, 0xc003dfa3f0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0})
	>  	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/client/client.go:103 +0x7d
	>  github.com/spacemeshos/go-spacemesh/systest/testcontext.New(0xc000187380, {0xc0003c5f18, 0x1, 0x5ac?})
	>  	/build/systest/testcontext/context.go:291 +0x32e
	>  github.com/spacemeshos/go-spacemesh/systest/tests.TestPartition_30_70(0xc0001031e0?)
	>  	/build/systest/tests/partition_test.go:174 +0xc8
	>  testing.tRunner(0xc000187380, 0x1e6c4c0)
	>  	/usr/local/go/src/testing/testing.go:1595 +0xff
	>  created by testing.(*T).Run in goroutine 1
	>  	/usr/local/go/src/testing/testing.go:1648 +0x3ad

This PR tries to fix that warning

Changes

  • set a logger for controller-runtime in system tests

Test Plan

n/a

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #5095 (0f4531a) into develop (41434a0) will increase coverage by 0.0%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           develop   #5095   +/-   ##
=======================================
  Coverage     77.0%   77.0%           
=======================================
  Files          257     257           
  Lines        30278   30278           
=======================================
+ Hits         23328   23344   +16     
+ Misses        5423    5407   -16     
  Partials      1527    1527           

see 6 files with indirect coverage changes

@fasmat
Copy link
Member Author

fasmat commented Sep 27, 2023

bors merge

bors bot pushed a commit that referenced this pull request Sep 27, 2023
## Motivation
System tests sometimes complain with a warning about this issue:

```
[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.
Detected at:
	>  goroutine 89 [running]:
	>  runtime/debug.Stack()
	>  	/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
	>  sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
	>  	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/log/log.go:60 +0xcd
	>  sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithName(0xc0001f3400, {0x1d7b101, 0x14})
	>  	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/log/deleg.go:147 +0x45
	>  github.com/go-logr/logr.Logger.WithName({{0x201aac0, 0xc0001f3400}, 0x0}, {0x1d7b101?, 0x1d63709?})
	>  	/go/pkg/mod/github.com/go-logr/logr@v1.2.4/logr.go:336 +0x3d
	>  sigs.k8s.io/controller-runtime/pkg/client.newClient(0x1d09720?, {0x0, 0xc003dfa3f0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0})
	>  	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/client/client.go:122 +0xec
	>  sigs.k8s.io/controller-runtime/pkg/client.New(0x20024e0?, {0x0, 0xc003dfa3f0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0})
	>  	/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/client/client.go:103 +0x7d
	>  github.com/spacemeshos/go-spacemesh/systest/testcontext.New(0xc000187380, {0xc0003c5f18, 0x1, 0x5ac?})
	>  	/build/systest/testcontext/context.go:291 +0x32e
	>  github.com/spacemeshos/go-spacemesh/systest/tests.TestPartition_30_70(0xc0001031e0?)
	>  	/build/systest/tests/partition_test.go:174 +0xc8
	>  testing.tRunner(0xc000187380, 0x1e6c4c0)
	>  	/usr/local/go/src/testing/testing.go:1595 +0xff
	>  created by testing.(*T).Run in goroutine 1
	>  	/usr/local/go/src/testing/testing.go:1648 +0x3ad
```

This PR tries to fix that warning

## Changes
- set a logger for controller-runtime in system tests

## Test Plan
n/a

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed
- [x] Update [changelog](../CHANGELOG.md) as needed
@bors
Copy link

bors bot commented Sep 27, 2023

Pull request successfully merged into develop.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title Fix "log.SetLogger(...) was never called" warning [Merged by Bors] - Fix "log.SetLogger(...) was never called" warning Sep 27, 2023
@bors bors bot closed this Sep 27, 2023
@bors bors bot deleted the fix-systest-complaints branch September 27, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants