Skip to content

Race condition in commands using watch #1109

@akerekes

Description

@akerekes

Bug report

The wait.Wait.Wait() implementations create the watch they are listen to in a goroutine that can execute later than the code that emits the event the watch was intended for.

Expected behavior

The watch is created upfront, then the wait for the event is executed in a goroutine while the main thread calls the backend that will emit the expected event.

Steps to reproduce the problem

I was able reproduce this by:

  • adding 30 seconds sleep into vi/client.go's WatchRevision method before the watch is created on the backend
  • call kn revision delete --wait <rev_name>

kn version

HEAD

Knative (serving/eventing) version

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions