Skip to content

Think about asynchronous/multithreading support #21

@SergiusTheBest

Description

@SergiusTheBest

@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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions