-
Notifications
You must be signed in to change notification settings - Fork 10
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
tests: fix Insights test, increase certain timeouts #66
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We are getting warnings like these: WARNING: Waiting for !ph_in_text("body","User doc is member of more organizations, but no organization was selected") took 7.7 seconds, which is 51% of the timeout. WARNING: Waiting for !ph_is_present("footer .pf-m-primary") took 8.7 seconds, which is 58% of the timeout. Hence extend the timeout for some of the changes related to registering, unregistering, and Insights status change. Co-authored-by: Marius Vollmer <[email protected]>
When querying for the details of a system, properly return 404 in case the system was not registered previously. This makes sure that insights-client properly reacts to this situation, mimicking what happens with a real Inventory service.
The sequence of events in the test is the following: 1) register with insights-client, a new machine-id is generated 2) the test moves away the machine-id file 3) a new data upload is triggered by starting the systemd service 4) insights-client eagerly generates a new machine-id file to check whether it is registered even if it is not the case (that's another issue, much harder to fix) 5) the newly generated machine-id has nothing associated to it 6) a proper warning is shown as expected 7) the original machine-id is restored 8) everything else continues as usual This worked fine until recent times, as the new machine-id always had a new UUID. After recent changes in insights-core [1], now the default machine-id generated by insights-client when the system is registered with subscription-manager is the subscription-manager UUID. Thus, the machine-id file generated during step (4) is now always the same, which then allows insights-client to query for its own details as if nothing happened. To break insights-client again, the changes are in the following step of the above sequence: 4) a new random UUID is written as machine-id file This new "wrong" machine-id file makes insights-client think that the status is not correct, and thus the test can keep going as expected. [1] RedHatInsights/insights-core#4057
ptoscano
force-pushed
the
ptoscano/tests-insights-fixes
branch
from
April 17, 2024 14:10
0aab1e2
to
bbac2c3
Compare
m-horky
approved these changes
Apr 17, 2024
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.
ACK
Ah,now I get what you were saying about mock-insights not returning a failure! Nice, this is a much faster failure than failing the upload at the end. Thanks! |
1 task
martinpitt
added a commit
to cockpit-project/bots
that referenced
this pull request
Jun 4, 2024
Fixed in sub-man main branch in candlepin/subscription-manager-cockpit#66 but not yet in the stable -1.28 branch. Known issue #6466
jelly
pushed a commit
to cockpit-project/bots
that referenced
this pull request
Jun 4, 2024
Fixed in sub-man main branch in candlepin/subscription-manager-cockpit#66 but not yet in the stable -1.28 branch. Known issue #6466
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix the tests, and in particular
testSubAndInAndFail
, to ensure they work properly in all the cases, and also with newer versions ofinsights-core
:mock-insights
to properly error out when querying for an unregistered systeminsights-client
according to newer changes ininsights-core
See the messages of the various commits for much longer descriptions of the reasons & changes.