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

update metric_calculator_test to work on arm #38431

Merged

Conversation

dehaansa
Copy link
Contributor

@dehaansa dehaansa commented Mar 6, 2025

Description

Update the metric_calculator_test's TestSweep to not test the behavior of the internal go timer in a way that causes arm tests to fail.

On linked issue, I added these comments to the existing test to describe the existing behavior, this PR drops the last assert and causes the existing assert to check that the passed clock time is greater than the expected amount of TTLs, which appears to be the original intent.

for i := 1; i <= 2; i++ {
	// sweepTime is the time that the internal ticker _expected_ to tick, may not be close (1ms) to the current time
	sweepTime := <-sweepEvent
	// tickTime is the time since test start plus the # of expected ticks
	tickTime := time.Since(start) + mwe.ttl*time.Duration(i)
	require.False(t, closed.Load())
	// This is asserting that the ttl is less than or equal to the time since the start captured before the mwe.sweep function was called,
	// so it's asserting that time consumed until now is greater than one ttl. Should probably be ttl * i, and tickTime should just be time.Since(start)
	assert.LessOrEqual(t, mwe.ttl, tickTime)
	// This is asserting that the time since the _expected_ current tick time is less than or equal to the ttl.
	// This is just testing if the internal timer got to schedule its tick well, and isn't late? This is go runtime behavior, not MWE behavior.
	assert.LessOrEqual(t, time.Since(sweepTime), mwe.ttl)
}

Link to tracking issue

Fixes #38205
Relevant to #38204

@dehaansa dehaansa marked this pull request as ready for review March 6, 2025 15:52
@dehaansa dehaansa requested a review from a team as a code owner March 6, 2025 15:52
@dehaansa dehaansa requested a review from crobert-1 March 6, 2025 15:52
@dehaansa dehaansa added Skip Changelog PRs that do not require a CHANGELOG.md entry Run ARM Enable running ARM tests on a PR labels Mar 6, 2025
@github-actions github-actions bot requested review from Aneurysm9 and mxiamxia March 6, 2025 15:52
@atoulme atoulme merged commit c13d87b into open-telemetry:main Mar 6, 2025
186 of 189 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal/aws Run ARM Enable running ARM tests on a PR Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

metric_calculator_test is failing on ARM
3 participants