Project

General

Profile

Bug #24759

Intermittent API FactValuesControllerTest failures

Added by Tomer Brisker 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Api::V2::FactValuesControllerTest.test_0006_should search facts by location and Api::V2::FactValuesControllerTest.test_0007_should search facts by organiztion are randomly failing with:

Expected response to be a <2XX: success>, but was a <500: Internal Server Error>
Response body: {
  "error": {"message":"undefined method `class_name' for nil:NilClass\nDid you mean?  class_eval"}
}

Associated revisions

Revision a7546562 (diff)
Added by Tomer Brisker 4 months ago

Fixes #24759 - Fix failing API FactValueController tests

API FactValueController test failed randomly with `undefined method
'class_name' for nil:NilClass`. This was caused by Rails not knowing
how to calculate the class name for the parent_fact_name relation,
leading the `parent_scope` function in the API base controller to fail
whenever the search in the associations hit the parent_fact_name prior
to finding the requested name. Explicitly naming the class name prevents
the error.

History

#1 Updated by The Foreman Bot 4 months ago

  • Assignee set to Tomer Brisker
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6013 added

#2 Updated by Michael Moll 4 months ago

  • Fixed in Releases 1.20.0 added

#3 Updated by Tomer Brisker 4 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF