Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem: fails three tests due to a hard-coded date used as the end date of alerts created inside the tests.
https://github.com/grafana/grafana/pull/65722
Version-Release number of selected component (if applicable): 9.0.9-2
How reproducible: always
Steps to Reproduce:
1. Rebuild grafana-9.0.9-2 against current build root with tests enabled
2. Review rpmbuild failure due to building after March 31, 2023.
Actual results:
Tests fail unexpectedly
Expected results:
Tests complete successfully
Additional info:
Originally, the error will look like this, obscuring the error.
```
--- FAIL: TestAMConfigAccess (0.40s)
testinfra.go:31: Grafana is listening on 127.0.0.1:41275
--- FAIL: TestAMConfigAccess/when_creating_silence (0.03s)
--- FAIL: TestAMConfigAccess/when_creating_silence/editor_request_should_succeed (0.01s)
api_alertmanager_test.go:264:
Error Trace: api_alertmanager_test.go:264
Error: Not equal:
expected: 202
actual : 400
Test: TestAMConfigAccess/when_creating_silence/editor_request_should_succeed
--- FAIL: TestAMConfigAccess/when_creating_silence/admin_request_should_succeed (0.01s)
api_alertmanager_test.go:264:
Error Trace: api_alertmanager_test.go:264
Error: Not equal:
expected: 202
actual : 400
Test: TestAMConfigAccess/when_creating_silence/admin_request_should_succeed
api_alertmanager_test.go:325:
Error Trace: api_alertmanager_test.go:325
Error: "[]" should have 2 item(s), but has 0
Test: TestAMConfigAccess
--- FAIL: TestAMConfigAccess/when_deleting_a_silence (0.00s)
--- FAIL: TestAMConfigAccess/when_deleting_a_silence/un-authenticated_request_should_fail (0.00s)
panic: runtime error: index out of range [0] with length 0 [recovered]
panic: runtime error: index out of range [0] with length 0
goroutine 3163 [running]:
testing.tRunner.func1.2({0x3174960, 0xc0022fb650})
/usr/lib/golang/src/testing/testing.go:1396 +0x24e
testing.tRunner.func1()
/usr/lib/golang/src/testing/testing.go:1399 +0x39f
panic({0x3174960, 0xc0022fb650})
/usr/lib/golang/src/runtime/panic.go:884 +0x212
github.com/grafana/grafana/pkg/tests/api/alerting.TestAMConfigAccess.func5.1(0xc003cb1520)
/builddir/build/BUILD/grafana-9.0.9/pkg/tests/api/alerting/api_alertmanager_test.go:362 +0x3d7
testing.tRunner(0xc003cb1520, 0xc003cc1440)
/usr/lib/golang/src/testing/testing.go:1446 +0x10b
created by testing.(*T).Run
/usr/lib/golang/src/testing/testing.go:1493 +0x35f
FAIL github.com/grafana/grafana/pkg/tests/api/alerting 34.904s
```
Upon patching the test to fail on the response body instead, we observe the actual error which was obscured by the test's evaluation of the response code before response body.
```
--- FAIL: TestAMConfigAccess (0.30s)
testinfra.go:31: Grafana is listening on 127.0.0.1:35835
--- FAIL: TestAMConfigAccess/when_creating_silence (0.03s)
--- FAIL: TestAMConfigAccess/when_creating_silence/editor_request_should_succeed (0.01s)
api_alertmanager_test.go:270:
Error Trace: api_alertmanager_test.go:270
Error: "{\"message\":\"end time can't be in the past: unable to create silence\",\"traceID\":\"00000000000000000000000000000000\"}" does not contain "{\"id\":\"0\",\"message\":\"silence created\"}"
Test: TestAMConfigAccess/when_creating_silence/editor_request_should_succeed
--- FAIL: TestAMConfigAccess/when_creating_silence/admin_request_should_succeed (0.01s)
api_alertmanager_test.go:270:
Error Trace: api_alertmanager_test.go:270
Error: "{\"message\":\"end time can't be in the past: unable to create silence\",\"traceID\":\"00000000000000000000000000000000\"}" does not contain "{\"id\":\"0\",\"message\":\"silence created\"}"
Test: TestAMConfigAccess/when_creating_silence/admin_request_should_succeed
api_alertmanager_test.go:325:
Error Trace: api_alertmanager_test.go:325
Error: "[]" should have 2 item(s), but has 0
Test: TestAMConfigAccess
--- FAIL: TestAMConfigAccess/when_deleting_a_silence (0.00s)
--- FAIL: TestAMConfigAccess/when_deleting_a_silence/un-authenticated_request_should_fail (0.00s)
panic: runtime error: index out of range [0] with length 0 [recovered]
panic: runtime error: index out of range [0] with length 0
```
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: grafana security and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2023:6420