You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "ASF GitHub Bot (Jira) via issues" <is...@yunikorn.apache.org> on 2026/10/31 14:51:00 UTC

[jira] [Updated] (YUNIKORN-3542) [Shim] Coverage of the stop case in the async dispatch goroutine depends on timing

     [ https://issues.apache.org/jira/browse/YUNIKORN-3542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated YUNIKORN-3542:
-------------------------------------
    Labels: pull-request-available  (was: )

> [Shim] Coverage of the stop case in the async dispatch goroutine depends on timing
> ----------------------------------------------------------------------------------
>
>                 Key: YUNIKORN-3542
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-3542
>             Project: Apache YuniKorn
>          Issue Type: Test
>          Components: shim - kubernetes, test - unit
>            Reporter: YUNG_CHENG
>            Assignee: YUNG_CHENG
>            Priority: Major
>              Labels: pull-request-available
>
> h3. Problem
> {{asyncDispatch()}} in {{pkg/dispatcher/dispatcher.go}} starts a goroutine that waits until the event fits in the channel, the dispatcher is stopped, or the retry timer fires. The {{case <-stop}} branch only runs when the dispatcher is stopped while that goroutine is still waiting.
> No test sets this up on purpose. Only {{TestExceedAsyncDispatchLimit}} reaches it, through its deferred {{Stop()}}, and only when the async goroutine has not yet put its event on the channel. Running that test alone covered the line in 3 of 6 runs; the whole package covered it in 9 of 10.
> The tests always pass, but the project coverage changes between runs. On [PR #1129|https://github.com/apache/yunikorn-k8shim/pull/1129] the {{codecov/project}} check failed with -0.01%: the only line that lost coverage is the {{return}} at {{dispatcher.go:186}}, and that PR only changes {{go.mod}} and {{go.sum}}.
> h3. Proposal
> Add a unit test that blocks the event handler, fills the event channel so that one event goes to async dispatch, and then stops the dispatcher. The goroutine can only leave through the stop channel, so the branch runs on every test run.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: issues-help@yunikorn.apache.org