From c48ce7e07cf2834c538be9e8ec653a244245c8a6 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Mon, 13 Nov 2023 16:09:13 -0500 Subject: [PATCH] fix: no_blocking.test.w flaking (#4921) Fixes #4874 ## Checklist - [ ] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [ ] Description explains motivation and solution - [ ] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*. --- examples/tests/sdk_tests/topic/no_blocking.test.w | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tests/sdk_tests/topic/no_blocking.test.w b/examples/tests/sdk_tests/topic/no_blocking.test.w index d6ad8df8560..271b09f5024 100644 --- a/examples/tests/sdk_tests/topic/no_blocking.test.w +++ b/examples/tests/sdk_tests/topic/no_blocking.test.w @@ -18,8 +18,8 @@ test "topic subscribers are invoked without blocking" { // since the subscriber sleeps for 3 seconds, the counter should still be 0 assert(counter.peek() == 0); - util.sleep(6s); - // after a while, the counter should be 1 + util.waitUntil(inflight () => { return counter.peek() == 1; }, interval: 1s, timeout: 30s); + assert(counter.peek() == 1); }