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

Force server FQDN to lowercase, for handling windows output gracefully. #89

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

mjtrangoni
Copy link
Owner

Extend fixture test case as well.

See,

--- FAIL: TestParseLmstatLicenseInfoServer (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=0x2 addr=0x28 pc=0x102cb46d4]

goroutine 38 [running]:
testing.tRunner.func1.2({0x102dcd700, 0x10311b520})
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1545 +0x1c8
testing.tRunner.func1()
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1548 +0x360
panic({0x102dcd700?, 0x10311b520?})
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/runtime/panic.go:914 +0x218
github.com/mjtrangoni/flexlm_exporter/collector.parseLmstatLicenseInfoServer({0x140000de300, 0x10, 0x200?})
        /Users/mtrangoni/git/flexlm_exporter.git/collector/lmstat.go:233 +0x1e4
github.com/mjtrangoni/flexlm_exporter/collector.TestParseLmstatLicenseInfoServer(0x140002151e0)
        /Users/mtrangoni/git/flexlm_exporter.git/collector/lmstat_test.go:164 +0x844
testing.tRunner(0x140002151e0, 0x102e45fc0)
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1595 +0xe8
created by testing.(*T).Run in goroutine 1
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1648 +0x33c
FAIL    github.com/mjtrangoni/flexlm_exporter/collector 0.343s

@cloudrck cloud please test this branch, and let know if this solve your issue? #80.

Please also check if you see any uppercase server name label in your metrics. It would indicate that something else needs to be lowered.

Thank you!

Extend fixture test case as well.

See,
```
--- FAIL: TestParseLmstatLicenseInfoServer (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=0x2 addr=0x28 pc=0x102cb46d4]

goroutine 38 [running]:
testing.tRunner.func1.2({0x102dcd700, 0x10311b520})
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1545 +0x1c8
testing.tRunner.func1()
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1548 +0x360
panic({0x102dcd700?, 0x10311b520?})
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/runtime/panic.go:914 +0x218
github.com/mjtrangoni/flexlm_exporter/collector.parseLmstatLicenseInfoServer({0x140000de300, 0x10, 0x200?})
        /Users/mtrangoni/git/flexlm_exporter.git/collector/lmstat.go:233 +0x1e4
github.com/mjtrangoni/flexlm_exporter/collector.TestParseLmstatLicenseInfoServer(0x140002151e0)
        /Users/mtrangoni/git/flexlm_exporter.git/collector/lmstat_test.go:164 +0x844
testing.tRunner(0x140002151e0, 0x102e45fc0)
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1595 +0xe8
created by testing.(*T).Run in goroutine 1
        /opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1648 +0x33c
FAIL    github.com/mjtrangoni/flexlm_exporter/collector 0.343s
```

Signed-off-by: Mario Trangoni <[email protected]>
Copy link

Coverage Status

coverage: 40.629%. remained the same
when pulling 0267673 on fix-nil-pointer
into 328696e on main.

@cloudrck
Copy link

@mjtrangoni Looks like this, indeed fixed the issue. Thanks for the quick fix

@mjtrangoni mjtrangoni merged commit ad956d0 into main Nov 28, 2023
6 checks passed
@mjtrangoni mjtrangoni deleted the fix-nil-pointer branch November 28, 2023 14:46
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.

2 participants