-
Notifications
You must be signed in to change notification settings - Fork 146
Fixing tests #322
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
Fixing tests #322
Conversation
houndci-bot
left a comment
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.
Some files could not be reviewed due to errors:
Error: obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in...
Error: obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in .rubocop.yml `Style/IfUnlessModifier: MaxLineLength` has been removed. Use `Metrics/LineLength: Max` instead
Added a nil guard.
houndci-bot
left a comment
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.
Some files could not be reviewed due to errors:
Error: obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in...
Error: obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in .rubocop.yml `Style/IfUnlessModifier: MaxLineLength` has been removed. Use `Metrics/LineLength: Max` instead
houndci-bot
left a comment
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.
Some files could not be reviewed due to errors:
Error: obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in...
Error: obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in .rubocop.yml `Style/IfUnlessModifier: MaxLineLength` has been removed. Use `Metrics/LineLength: Max` instead
The option to submit a P12 key is no longer available. See fog@f1607b4
houndci-bot
left a comment
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.
Some files could not be reviewed due to errors:
Error: obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in...
Error: obsolete parameter MaxLineLength (for Style/IfUnlessModifier) found in .rubocop.yml `Style/IfUnlessModifier: MaxLineLength` has been removed. Use `Metrics/LineLength: Max` instead
| assert_kind_of(Fog::Compute::Google::Real, c) | ||
| end | ||
|
|
||
|
|
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.
Layout/TrailingWhitespace: Trailing whitespace detected.
|
Ahhhh, so it was a parameter, not a rule... @icco FYI I fixed hound. |
Validation changed from client-side to method in: fog@9e13610 Adjusting the test to match.
API library method changed to parameters instead of hashes. Now the resources are cleaning up correctly.
| list_resp = @client.monitoring.list_project_metric_descriptors( | ||
| :filter => "metric.type = starts_with(\"#{TEST_METRIC_PREFIX}\")" | ||
| "projects/#{@client.project}", | ||
| filter: "metric.type = starts_with(\"#{TEST_METRIC_PREFIX}\")" |
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.
Style/HashSyntax: Use hash rockets syntax.
API Client now returns a bad request exception if the metric is not yet created, so needed to insert a Retriable step.
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, | ||
| base_interval: 30) do |
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.
Style/HashSyntax: Use hash rockets syntax.
| # Retriable is used instead of wait_for due to API client returning Google::Apis::ClientError: badRequest if the | ||
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, |
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.
Style/HashSyntax: Use hash rockets syntax.
| # Wait for metric to be created | ||
| # Retriable is used instead of wait_for due to API client returning Google::Apis::ClientError: badRequest if the | ||
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, |
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.
Style/HashSyntax: Use hash rockets syntax.
Layout/SpaceInsideHashLiteralBraces: Space inside { missing.
Layout/SpaceInsideHashLiteralBraces: Space inside } missing.
| tries: 2, | ||
| base_interval: 30) do | ||
| @client.list_timeseries( | ||
| :filter => "metric.type = \"#{metric_type}\"", |
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.
Layout/FirstParameterIndentation: Indent the first parameter one step more than the start of the previous line.
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, | ||
| base_interval: 30) do |
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.
Style/HashSyntax: Use hash rockets syntax.
| # Retriable is used instead of wait_for due to API client returning Google::Apis::ClientError: badRequest if the | ||
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, |
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.
Style/HashSyntax: Use hash rockets syntax.
| # Wait for metric to be created | ||
| # Retriable is used instead of wait_for due to API client returning Google::Apis::ClientError: badRequest if the | ||
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, |
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.
Style/HashSyntax: Use hash rockets syntax.
Layout/SpaceInsideHashLiteralBraces: Space inside { missing.
Layout/SpaceInsideHashLiteralBraces: Space inside } missing.
|
Ok, now we’re down to 6 errors versus 30something when I got started. Still working on it. |
Instances now appear to enter STAGING almost immidiately, making checks for PROVISIONING fail. See: https://cloud.google.com/compute/docs/instances/checking-instance-status
Instances are now STAGING almost immidiately, so the wait_for timed out.
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, | ||
| base_interval: 30) do |
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.
Style/HashSyntax: Use hash rockets syntax.
| # Retriable is used instead of wait_for due to API client returning Google::Apis::ClientError: badRequest if the | ||
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, |
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.
Style/HashSyntax: Use hash rockets syntax.
|
Network model gateway and ipv4 range fields seem to not be functional due to a typo in the GoogleAPI lib: googleapis/google-api-ruby-client#666 I'm not entirely sure how to populate the data properly, since the aliases do not seem to work when instantiating a class, i.e.: 😕 I'll try tackling this tomorrow a bit more. |
See code comment
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, | ||
| base_interval: 30) do |
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.
Style/HashSyntax: Use hash rockets syntax.
| # Retriable is used instead of wait_for due to API client returning Google::Apis::ClientError: badRequest if the | ||
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, |
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.
Style/HashSyntax: Use hash rockets syntax.
| url_map.merge(:name => url_map_name) | ||
| ) | ||
| @compute.insert_url_map(@project, url_map_obj) | ||
| # HACK - Currently URL map insert may fail even though the backend |
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.
Style/CommentAnnotation: Annotation keywords like HACK should be all upper case, followed by a colon, and a space, then a note describing the problem.
|
Ok, one test left to fix. I'll address Hound with the final commit to not pepper them everywhere and see if anything's failing after changing the hash format. |
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, | ||
| base_interval: 30) do |
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.
Style/HashSyntax: Use hash rockets syntax.
| # Retriable is used instead of wait_for due to API client returning Google::Apis::ClientError: badRequest if the | ||
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, |
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.
Style/HashSyntax: Use hash rockets syntax.
| # Now that we have an address, we can create a server using the static ip | ||
| server_name = new_resource_name | ||
| client.servers.create( | ||
|
|
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.
Layout/TrailingWhitespace: Trailing whitespace detected.
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, | ||
| base_interval: 30) do |
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.
Style/HashSyntax: Use hash rockets syntax.
| # Retriable is used instead of wait_for due to API client returning Google::Apis::ClientError: badRequest if the | ||
| # metric hasn't yet been created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => /The provided filter doesn't refer to any known metric./}, | ||
| tries: 2, |
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.
Style/HashSyntax: Use hash rockets syntax.
|
Ok, so now only some flaky tests are left. Most notably the stackdriver API: It's so flaky I think I just need to make a generic wrapper around it in the request itself. I'll sleep on it. |
|
Apparently this is a known problem with stackdriver metric, sometimes it requires 80+ seconds for the metric to become available: I'll try wrapping everything in backoff |
See comment
This is an attempt to resolve clashing tests between addresses and disks models due to them having a similar prefix and trying to delete eachother's leftover resources.
| ) | ||
| series = Retriable.retriable(on: {Google::Apis::ClientError => NOT_READY_REGEX}, | ||
| tries: RETRIABLE_TRIES, | ||
| base_interval: RETRIABLE_BASE_INTERVAL) do |
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.
Style/HashSyntax: Use hash rockets syntax.
| :interval => interval | ||
| ) | ||
| series = Retriable.retriable(on: {Google::Apis::ClientError => NOT_READY_REGEX}, | ||
| tries: RETRIABLE_TRIES, |
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.
Style/HashSyntax: Use hash rockets syntax.
| ], | ||
| :interval => interval | ||
| ) | ||
| series = Retriable.retriable(on: {Google::Apis::ClientError => NOT_READY_REGEX}, |
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.
Style/HashSyntax: Use hash rockets syntax.
Layout/SpaceInsideHashLiteralBraces: Space inside { missing.
Layout/SpaceInsideHashLiteralBraces: Space inside } missing.
| ) | ||
| resp = Retriable.retriable(on: {Google::Apis::ClientError => NOT_READY_REGEX}, | ||
| tries: RETRIABLE_TRIES, | ||
| base_interval: RETRIABLE_BASE_INTERVAL) do |
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.
Layout/AlignHash: Align the elements of a hash literal if they span more than one line.
Style/HashSyntax: Use hash rockets syntax.
| :page_size => 1 | ||
| ) | ||
| resp = Retriable.retriable(on: {Google::Apis::ClientError => NOT_READY_REGEX}, | ||
| tries: RETRIABLE_TRIES, |
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.
Layout/AlignHash: Align the elements of a hash literal if they span more than one line.
Style/HashSyntax: Use hash rockets syntax.
| @client.create_timeseries(:timeseries => timeseries) | ||
| Retriable.retriable(on: Google::Apis::ServerError, | ||
| tries: RETRIABLE_TRIES, | ||
| base_interval: RETRIABLE_BASE_INTERVAL) do |
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.
Style/HashSyntax: Use hash rockets syntax.
|
|
||
| @client.create_timeseries(:timeseries => timeseries) | ||
| Retriable.retriable(on: Google::Apis::ServerError, | ||
| tries: RETRIABLE_TRIES, |
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.
Style/HashSyntax: Use hash rockets syntax.
| end | ||
|
|
||
| @client.create_timeseries(:timeseries => timeseries) | ||
| Retriable.retriable(on: Google::Apis::ServerError, |
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.
Style/HashSyntax: Use hash rockets syntax.
|
|
||
| series = Retriable.retriable(on: {Google::Apis::ClientError => NOT_READY_REGEX}, | ||
| tries: RETRIABLE_TRIES, | ||
| base_interval: RETRIABLE_BASE_INTERVAL) do |
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.
Layout/AlignHash: Align the elements of a hash literal if they span more than one line.
Style/HashSyntax: Use hash rockets syntax.
| end | ||
|
|
||
| series = Retriable.retriable(on: {Google::Apis::ClientError => NOT_READY_REGEX}, | ||
| tries: RETRIABLE_TRIES, |
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.
Layout/AlignHash: Align the elements of a hash literal if they span more than one line.
Style/HashSyntax: Use hash rockets syntax.
Since we no longer support 1.8/1.9 ruby anyway.
|
All tests pass \o/ |
| tries: RETRIABLE_TRIES, | ||
| base_interval: RETRIABLE_BASE_INTERVAL) do | ||
| @client.list_timeseries( | ||
| :filter => "metric.type = \"#{metric_type}\"", |
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.
Layout/FirstParameterIndentation: Indent the first parameter one step more than the start of the previous line.
| } | ||
| ) | ||
| # Wait for metric to be created | ||
| Retriable.retriable(on: {Google::Apis::ClientError => NOT_READY_REGEX}, |
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.
Layout/SpaceInsideHashLiteralBraces: Space inside { missing.
Layout/SpaceInsideHashLiteralBraces: Space inside } missing.
|
Reran 2 times, some additional flakiness is left. I'll attempt to debug. |
In an attempt to resolve flaky tests due to model deletion
|
Ok, I'll merge this to be able to test other PR's and open a new branch to fix the leftover disk flakiness. |
|
Thanks for this! |
Fixing up tests so we can rely on CI for breakages. Starting with a rather embarrassing regression I introduced.