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

A cron interaction tests keeps growing in time #49

Open
rzadp opened this issue Sep 9, 2024 · 3 comments
Open

A cron interaction tests keeps growing in time #49

rzadp opened this issue Sep 9, 2024 · 3 comments
Assignees

Comments

@rzadp
Copy link
Contributor

rzadp commented Sep 9, 2024

One of those tests keeps growing in time, on every new referendum.

We should somehow limit this.

@Bullrich
Copy link
Contributor

I don't really know how to fix this problem.

I have been trying to get the referendas and invert their order, and stop as soon as I find an older rfc than the start date, but some events occur latter than a new one, breaking that idea.

There is no way to filter them before fetching them, right?

@rzadp
Copy link
Contributor Author

rzadp commented Sep 10, 2024

some events occur latter than a new one, breaking that idea.

Events? But I see that we iterate over their indexes.
Do you mean a referendum number 100 can have a start date earlier than referendum 99?

@Bullrich
Copy link
Contributor

Events? But I see that we iterate over their indexes. Do you mean a referendum number 100 can have a start date earlier than referendum 99?

We use two types of dates:

  • Ongoing referenda: When it was submitted.
  • approved, rejected, timedOut, killed or cancelled: When it got to this stage.

It can be that we have 3 rfcs:

  1. Is ongoing and was submitted at 6pm
  2. Is closed and it was closed at 9pm
  3. Is ongoing and was submitted at 7pm

My first thought was to check the array in an inverted order: Iterate on [3, 2, 1] and, if the date of the event is older than the startDate, break the loop and assume that any referenda with a lower index will be older.

But as I just showed in the example, it can happen than a value with a lower index changed it state on a later date, making my thought process wrong.

Now, I don't really know how to proceed, as I can't discard earlier indexes given that they may have a more modern state, but the list will only continue to grow.

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

When branches are created from issues, their pull requests are automatically linked.

2 participants