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

wasm: fixes test flake on Windows and strict mode #3041

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

codefromthecrypt
Copy link
Contributor

Description

Windows clocks often don't give microsecond scope reading reliably. Our "strict mode" test was accidentally verifying a lower bound of time spent sleeping, when the important part is the upper bound. This removes the lower bound, so that tests pass on both unix and windows.

Issue reference

See #2884 (comment)

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • [n/a] Extended the documentation / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]

@ItalyPaleAle
Copy link
Contributor

/ok-to-test

@ItalyPaleAle
Copy link
Contributor

I’m only interested In the windows tests so I’ll stop all other tests

@dapr-bot
Copy link
Collaborator

dapr-bot commented Aug 4, 2023

Complete Build Matrix

The build status is currently not updated here. Please visit the action run below directly.

🔗 Link to Action run

Commit ref: 3df9a1c

@dapr-bot

This comment was marked as off-topic.

@dapr-bot

This comment was marked as off-topic.

Copy link
Contributor

@ItalyPaleAle ItalyPaleAle left a comment

Choose a reason for hiding this comment

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

This doesn't seem to be working yet. It still fails because the delay is exactly 0 so it's never "greater than".

I can't leave a comment there, but you'll need to change L219 to:

assert.GreaterOrEqual(t, duration, tc.minDuration)
assert.LessOrEqual(t, duration, tc.maxDuration)

@codefromthecrypt
Copy link
Contributor Author

ah thanks for the keen eye, you are right this expression is wrong.

Windows clocks often don't give microsecond scope reading reliably. Our
"strict mode" test was accidentally verifying a lower bound of time
spent sleeping, when the important part is the upper bound. This removes
the lower bound, so that tests pass on both unix and windows.

See dapr#2884 (comment)

Signed-off-by: Adrian Cole <[email protected]>
@ItalyPaleAle
Copy link
Contributor

/ok-to-test

@dapr-bot
Copy link
Collaborator

dapr-bot commented Aug 4, 2023

Complete Build Matrix

The build status is currently not updated here. Please visit the action run below directly.

🔗 Link to Action run

Commit ref: 44d7c35

@dapr-bot

This comment was marked as off-topic.

@ItalyPaleAle ItalyPaleAle merged commit 80fdafc into dapr:master Aug 4, 2023
82 of 83 checks passed
@yaron2 yaron2 added this to the v1.12 milestone Oct 11, 2023
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.

4 participants