You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "Peter Bacsko (Jira)" <ji...@apache.org> on 2024/11/12 14:34:00 UTC
[jira] [Updated] (YUNIKORN-2971) Use FakeRecorder and MockedRecorder properly in the tests
[ https://issues.apache.org/jira/browse/YUNIKORN-2971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Bacsko updated YUNIKORN-2971:
-----------------------------------
Summary: Use FakeRecorder and MockedRecorder properly in the tests (was: Remove recorder type check from test cases)
> Use FakeRecorder and MockedRecorder properly in the tests
> ---------------------------------------------------------
>
> 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: issues-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: issues-help@yunikorn.apache.org