Skip to content

sbomexport: make deleted namespace cleanup test wait for handler #510

Open

Description

@matthyx

Description

TestExporterKeepsTheLayoutOfADeletedNamespace waits until the namespace lister no longer contains team-a, then advances the fake clock through the grace period and asserts the namespace metadata was cleaned up. The informer removes an object from the store before asynchronously delivering DeleteFunc; if that handler is delayed until after the resyncs, deletedNamespaces["team-a"] is still unset and the test can fail even though production behavior is correct.

Expected

Before advancing the clock for the cleanup assertion, wait with bounded polling until deletedNamespaces["team-a"] is set under te.mu. Keep TestExporterKeepsTheLayoutOfANamespaceTheListerAlreadyDropped as coverage for the pre-delete-handler interval.

Found during review of #501. This is a test reliability follow-up, not a blocker to the production fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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