Skip to content

Conversation

cx-artur-ribeiro
Copy link
Contributor

@cx-artur-ribeiro cx-artur-ribeiro commented Jul 18, 2025

Reason for Proposed Changes

  • TestCounter_Start randomly failed due to race condition and off-by-one error;

Proposed Changes

  • Corrected the number of expected progress updates (from 10 to 9);
  • Ensured process completes before verifying results;
  • Fixed a wrong increment in Start() caused by the progress channel closing.

Example Error
=== RUN TestCounter_Start/test_counter_progress_bar
counter_progress_test.go:52:
Error Trace: /home/runner/work/kics/kics/pkg/progress/counter/counter_progress_test.go:52
Error: Not equal:
expected: 9
actual : 10
Test: TestCounter_Start/test_counter_progress_bar

I submit this contribution under the Apache-2.0 license.

@cx-artur-ribeiro cx-artur-ribeiro self-assigned this Jul 18, 2025
@cx-artur-ribeiro cx-artur-ribeiro requested a review from a team as a code owner July 18, 2025 09:13
Copy link
Contributor

kics-logo

KICS version: v2.1.11

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 47
Queries failed to execute placeholder 0
Execution time placeholder 0

Copy link
Contributor

@cx-eduardo-semanas cx-eduardo-semanas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@cx-rui-araujo cx-rui-araujo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cx-artur-ribeiro check my comment

@cx-artur-ribeiro cx-artur-ribeiro merged commit ca1935a into master Jul 18, 2025
25 checks passed
@cx-artur-ribeiro cx-artur-ribeiro deleted the fix-flaky-progress-bar-test branch July 18, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants