-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Increase test scope of MariaDB + PostgreSQL tests #87019
Conversation
Cherry-picked the test fixes from #86436 This should pass now |
Looks like everything is good except for This appears to be a race order issue (not a production problem) in the test |
Should we adjust |
There are still a few postgresql history/stats tests that need the same fixes as the recorder versions of them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just marking this as requested changes
- we don't want to forget to adjust .core_files.yaml
and end up with unexpected issues in CI.
Was going to work on this today but ended up doing another pass on statistics since I thought I couldn't optimize it anymore and than I came up with an idea... #87859 so I'll pick this up this weekend instead |
…r is indeterminate
postgres has two issues
|
Its definitely creating the columns correctly
|
but the raw data all comes back with
|
CREATE TABLE states (
state_id INTEGER GENERATED BY DEFAULT AS IDENTITY,
entity_id VARCHAR(255),
state VARCHAR(255),
attributes TEXT,
event_id INTEGER,
last_changed TIMESTAMP WITH TIME ZONE,
last_changed_ts DOUBLE PRECISION,
last_updated TIMESTAMP WITH TIME ZONE,
last_updated_ts DOUBLE PRECISION,
old_state_id INTEGER,
attributes_id INTEGER,
context_id VARCHAR(36),
context_user_id VARCHAR(36),
context_parent_id VARCHAR(36),
origin_idx SMALLINT,
PRIMARY KEY (state_id),
FOREIGN KEY(event_id) REFERENCES events (event_id) ON DELETE CASCADE,
FOREIGN KEY(old_state_id) REFERENCES states (state_id),
FOREIGN KEY(attributes_id) REFERENCES state_attributes (attributes_id)
) Its being created correctly |
some other data it out of order as well for postgresql. but only sensor.test4 |
they are being recorded at the same time
|
So not the database |
@@ -3094,7 +3094,7 @@ def _sum(seq, last_state, last_sum): | |||
sum_attributes, | |||
seq[j : j + 1], | |||
) | |||
start_meter = start + timedelta(minutes=1) | |||
start_meter += timedelta(minutes=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug in the test, it was inserting rows with the same timestamp down to the microsecond so selecting them back resulted in an indeterminate order
There were no functional changes here. So it looks like our code is good, we just needed to fix some tests 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thanks |
Proposed change
Increase test scope of the MariaDB CI job
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: