Skip to content

Stabilize test cases which depends on execution timing #408

@kenhys

Description

@kenhys

Problem

sometimes GitHub Actions CI fails.


# Running:

................E.................................................

Finished in 30.258607s, 2.1812 runs/s, 4.4285 assertions/s.

  1) Error:
TestWatchNamespaces#test_0012_namespace watch retries when 410 Gone errors are encountered:
NoMethodError: undefined method `>=' for nil:NilClass
    test/plugin/test_watch_namespaces.rb:250:in `block (3 levels) in <class:TestWatchNamespaces>'
    test/plugin/test_watch_namespaces.rb:241:in `block (2 levels) in <class:TestWatchNamespaces>'
    test/plugin/test_watch_namespaces.rb:240:in `block in <class:TestWatchNamespaces>'

66 runs, 134 assertions, 0 failures, 1 errors, 0 skips
Coverage report generated for Unit Tests to /home/runner/work/fluent-plugin-kubernetes_metadata_filter/fluent-plugin-kubernetes_metadata_filter/coverage.
Line Coverage: 92.23% (962 / 1043)
rake aborted!
Command failed with status (1)
/home/runner/work/fluent-plugin-kubernetes_metadata_filter/fluent-plugin-kubernetes_metadata_filter/vendor/bundle/ruby/3.2.0/gems/rake-13.3.0/exe/rake:27:in `<top (required)>'
/opt/hostedtoolcache/Ruby/3.2.9/x64/bin/bundle:25:in `load'
/opt/hostedtoolcache/Ruby/3.2.9/x64/bin/bundle:25:in `<main>'
Tasks: TOP => test => base_test
(See full trace by running task with --trace)
Error: Process completed with exit code 1.

Expected

Always CI should pass

Additional Information

It seems that it raise Exception when timeout occurs before @stats was correctly set.
so these flaky test depends on execution timing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions