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

dev: upgrade time circuits and add a flux capacitor (engine cycle monitor and pgmocktime) #2438

Merged
merged 9 commits into from
Jun 14, 2022

Conversation

mastercactapus
Copy link
Member

Description:
This PR allows for the manipulation of space and time within the confines of a Postgres database.

It is now possible to move time forward, back, alter its speed, reverse its flow, and even go back to a specific point in the future. Engine cycles can be triggered using 2-stages for more efficient test runs (grab ID, trigger cycle, wait for ID).

This work also resolves a long-standing issue where the DB time code for smoketests changed the engine's perception of time, but failed to account for DEFAULT values in the tables. It is now possible to control things like alert-log timestamps to the millisecond, by freezing altering the passage of time.

  • There is a new endpoint /health/engine/cycle that will return the next engine cycle ID
  • The /health/engine endpoint now accepts an optional id= parameter
  • The pgmocktime tool was added that has both an API and CLI interface
  • Engine cycle triggering/monitoring was refactored into its own struct
  • Time and engine tasks have been moved into discrete cypress helper methods (instead of .task(...))
  • refactored cypress engine trigger code to wait for a full cycle cleanly (mirroring backend tests)

Screenshots:
image

c.cycles[c.history[0]] = make(chan struct{})
}

// startNextCycle marks the begining of the next engine cycle.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo on 'beginning'

@tony-tvu
Copy link
Collaborator

Great work on this @mastercactapus and @KatieMSB 🧠 !!

Copy link
Contributor

@Forfold Forfold left a comment

Choose a reason for hiding this comment

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

lgtm!

@mastercactapus mastercactapus merged commit 95183de into master Jun 14, 2022
@mastercactapus mastercactapus deleted the OUTATIME branch June 14, 2022 19:46
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.

3 participants