-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
@SergiusTheBest What do you think about new kmtest feature "REQUIRE_EVENTUALLY" for testing of multithreading code? There is an example of work with Eventually in gomega:
import (
. "github.com/onsi/gomega"
"time"
)
func TestAsyncOperation(t *testing.T) {
// Simulate an asynchronous operation that sets a flag after a delay
var done bool
go func() {
time.Sleep(100 * time.Millisecond)
done = true
}()
// Use Eventually to wait for the 'done' flag to become true
Eventually(func() bool {
return done
}).Should(BeTrue())
}
Originally posted by @belyshevdenis in apriorit/kf#67 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels