Skip to content

Added time checkers After, Before and Almost#168

Merged
hpidcock merged 1 commit intojuju:masterfrom
hpidcock:time-checkers
Aug 9, 2022
Merged

Added time checkers After, Before and Almost#168
hpidcock merged 1 commit intojuju:masterfrom
hpidcock:time-checkers

Conversation

@hpidcock
Copy link
Copy Markdown
Member

@hpidcock hpidcock commented Aug 9, 2022

Added time checkers:

  • After: obtained time is after the expected time.
  • Before: obtained time is before the expected time.
  • Almost: obtained time is at most 1s before or after the expected time.

Comment thread checkers/time.go
}

// Almost checks whether the obtained time.Time is within 1s of the want time.Time.
var Almost gc.Checker = &timeCompareChecker{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we add an option param for the time window? Default to 1s.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

can just use After and Before in combination.

@hpidcock hpidcock merged commit 4ac48ac into juju:master Aug 9, 2022
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.

2 participants