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

[chore] [internal/aws] Change TestMapWithExpiry to explicitly test cleanup #25097

Merged

Conversation

bryan-aguilar
Copy link
Contributor

Description: Changes the behavior of the specific test case to be more aligned with its behavior pre #25066

Link to tracking Issue: #25095

@bryan-aguilar bryan-aguilar requested review from Aneurysm9 and a team as code owners August 8, 2023 20:01
@bryan-aguilar
Copy link
Contributor Author

@dmitryax

@@ -130,14 +139,14 @@ func TestMapWithExpiryCleanup(t *testing.T) {
assert.Equal(t, 1, store.Size())
store.Unlock()

time.Sleep(time.Second + time.Millisecond)
time.Sleep(time.Second * 2)
Copy link
Member

Choose a reason for hiding this comment

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

This is a significant increase. Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's actually no need. I reduced it even further by dropping the TTL and the sleep time together.

@@ -130,14 +139,14 @@ func TestMapWithExpiryCleanup(t *testing.T) {
assert.Equal(t, 1, store.Size())
store.Unlock()

time.Sleep(time.Second + time.Millisecond)
time.Sleep(time.Millisecond * 2)
Copy link
Member

Choose a reason for hiding this comment

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

Is this sleep still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there ever a chance that time.Now() can return the same value? If so that would put a requirement for the sleep.

@dmitryax dmitryax changed the title [chore] Change TestMapWithExpiry to explicitly test cleanup [chore] [internal/aws] Change TestMapWithExpiry to explicitly test cleanup Aug 8, 2023
@dmitryax dmitryax merged commit df0c744 into open-telemetry:main Aug 8, 2023
89 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants