[
https://issues.apache.org/jira/browse/YUNIKORN-2971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Peter Bacsko updated YUNIKORN-2971:
-----------------------------------
Description:
Certain test cases in the shim verify the type of the event recorder:
{noformat}
recorder, ok := events.GetRecorder().(*k8sEvents.FakeRecorder)
if !ok {
t.Fatal("the EventRecorder is expected to be of type
FakeRecorder")
}
{noformat}
However, this just happens to pass by accident because a previous test modified
it from MockedRecorder to FakeRecorder. Running such a tests on its own fails.
Also make sure that all tests restore the recorder properly in a deferred code
section.
was:
Certain test cases in the shim verify the type of the event recorder:
{noformat}
recorder, ok := events.GetRecorder().(*k8sEvents.FakeRecorder)
if !ok {
t.Fatal("the EventRecorder is expected to be of type
FakeRecorder")
}
{noformat}
However, this just happens to pass by accident because a previous test modified
it from MockedRecorder to FakeRecorder. Running such tests individually fails.
Also make sure that all tests restore the recorder properly in a deferred code
section.
> Remove recorder type check from test cases
> ------------------------------------------
>
> Key: YUNIKORN-2971
> URL: https://issues.apache.org/jira/browse/YUNIKORN-2971
> Project: Apache YuniKorn
> Issue Type: Bug
> Components: shim - kubernetes, test - unit
> Reporter: Peter Bacsko
> Assignee: Peter Bacsko
> Priority: Major
>
> Certain test cases in the shim verify the type of the event recorder:
> {noformat}
> recorder, ok := events.GetRecorder().(*k8sEvents.FakeRecorder)
> if !ok {
> t.Fatal("the EventRecorder is expected to be of type
> FakeRecorder")
> }
> {noformat}
> However, this just happens to pass by accident because a previous test
> modified it from MockedRecorder to FakeRecorder. Running such a tests on its
> own fails.
> Also make sure that all tests restore the recorder properly in a deferred
> code section.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]