Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVED] Fix flaky tests #1564

Merged
merged 4 commits into from Feb 26, 2024
Merged

[IMPROVED] Fix flaky tests #1564

merged 4 commits into from Feb 26, 2024

Conversation

piotrpio
Copy link
Collaborator

Signed-off-by: Piotr Piotrowski piotr@synadia.com

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@piotrpio piotrpio marked this pull request as ready for review February 26, 2024 08:47
@piotrpio piotrpio changed the title [IMPROVED] Fix flaky KeyValueMirrorCrossDomains test [IMPROVED] Fix flaky tests Feb 26, 2024
@piotrpio piotrpio requested a review from Jarema February 26, 2024 08:52
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement of the CI relaiblity. Howeve, I think it would be nice to increase to Durations to make it more durable against slow CI workers.

// we know this request will take longer so extend the timeout
expirationTimer.Reset(100 * time.Millisecond)

// slower reply which would have hit original timeout
time.Sleep(90 * time.Millisecond)
time.Sleep(70 * time.Millisecond)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this change here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test depends on request either timing out or not depending on the circumstances. The expiration timer is reset in each subscribe callback to 100ms - sleeping for 90ms was making it fail quite often if there the subsequent request had 10ms delay. Now it's 30ms "buffer", which makes it less, but still, flaky...

I get why this test is useful but its tough to fix it entirely while retaining the logic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, gotcha. That feels pretty flaky no matter what we set here, seeing faster or slower machines running it...

test/js_test.go Outdated Show resolved Hide resolved
jetstream/test/kv_test.go Outdated Show resolved Hide resolved
@piotrpio piotrpio requested a review from Jarema February 26, 2024 11:00
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@piotrpio piotrpio merged commit 5b7ba3d into main Feb 26, 2024
2 checks passed
@piotrpio piotrpio deleted the fix-build-tests branch February 26, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants