[ 
https://issues.apache.org/jira/browse/YUNIKORN-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17785415#comment-17785415
 ] 

Wilfred Spiegelenburg commented on YUNIKORN-2089:
-------------------------------------------------

You can use a the bindTime that is passed in and set that to a known time 
before "now". That should give you a pretty good prediction range as we only 
use the whole seconds of the difference. The chance that a test would fail due 
to that should be extremely low.

Since we cast the float to an int this is true from the go spec 
https://go.dev/ref/spec#Conversions:
{quote}When converting a floating-point number to an integer, the fraction is 
discarded (truncation towards zero)
{quote}

> Move usedResource type and tests to their own files
> ---------------------------------------------------
>
>                 Key: YUNIKORN-2089
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-2089
>             Project: Apache YuniKorn
>          Issue Type: Improvement
>          Components: core - common
>            Reporter: Wilfred Spiegelenburg
>            Assignee: Vinayak Hegde
>            Priority: Major
>              Labels: newbie
>
> The UsedResource type should not be part of the resources.go file.
> All declarations and functions that have a UsedResource as receiver or return 
> value value should be moved. Unused functions should be removed.
> Unneeded exports on functions / types should be removed. If exported the 
> comments on the functions and types need to comply with standard go rules.
> All remaining functions should get tests to make sure they are working 
> correctly



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to