Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-log
Commits
ef16ad70
Commit
ef16ad70
authored
Apr 16, 2021
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: fix flaky label test
Sort order in JSON is not guaranteed.
parent
aa7b97a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
setup_test.go
setup_test.go
+2
-2
No files found.
setup_test.go
View file @
ef16ad70
...
...
@@ -139,7 +139,7 @@ func TestLogLabels(t *testing.T) {
}()
// set the go-log labels env var
os
.
Setenv
(
envLoggingLabels
,
"
app=example_app,
dc=sjc-1,foobar"
)
// foobar to ensure we don't panic on bad input.
os
.
Setenv
(
envLoggingLabels
,
"dc=sjc-1,foobar"
)
// foobar to ensure we don't panic on bad input.
defer
os
.
Unsetenv
(
envLoggingLabels
)
SetupLogging
(
configFromEnv
())
...
...
@@ -154,7 +154,7 @@ func TestLogLabels(t *testing.T) {
}
t
.
Log
(
buf
.
String
())
if
!
strings
.
Contains
(
buf
.
String
(),
"{
\"
app
\"
:
\"
example_app
\"
,
\"
dc
\"
:
\"
sjc-1
\"
}"
)
{
if
!
strings
.
Contains
(
buf
.
String
(),
"{
\"
dc
\"
:
\"
sjc-1
\"
}"
)
{
t
.
Errorf
(
"got %q, wanted it to contain log output"
,
buf
.
String
())
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment