cloudfoundry / cloudfoundry/cf-acceptance-tests

"SSO Lifecycle" tests obscure error from broker ApiInfoUrl

Open
#1,017 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
71
Forks
179
Avg merge
4d 43m
Merged PRs (30d)
35

Description

A "debugg-ability" issue.

current state

The failure we see in test output is:

  [FAILED] Expected
      <int>: 3
  to match exit code:
      <int>: 0
  In [BeforeEach] at: /go/src/github.com/cloudfoundry/cf-acceptance-tests/helpers/services/sso.go:46

Which corresponds to a non-zero exit code when curling the api info url. However, this is misleading. When we print out what the api info url is:

fmt.Println("apiInfoEndpoint is: ", apiInfoEndpoint)

right before a failed curl. We see that the value of apiInfoEndpoint is:

apiInfoEndpoint is:  http://{
    "error": true,
    "message": "undefined method `empty?' for nil:NilClass",
    "path": "http://cats-1-brkr-0007082c607e17d8.uaa-acceptance.cf-app.com/cf_api_info_url",
    "timestamp": "2024-01-02 15:56:42 +0000",
    "type": "500",
    "backtrace": [
     ...

As a comparison, right before a successful curl. The value of apiInfoEndpoint is: http://api.xxx.cf-app.com/v2/info.

This shows that an error from earlier code path was not caught.

After tracing backward the code path, we suspect that this code somehow is not able to detect an error. Is it an issue in http.Client or in the broker's /cf_api_info_url endpoint?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read helpers/services/sso.go around line 46 and helpers/services/broker.go around lines 138-144, then run the SSO Lifecycle tests to reproduce the misleading curl failure. Trace how the broker's /cf_api_info_url response becomes apiInfoEndpoint and determine where the earlier error should be surfaced; done means the test reports the underlying broker error instead of only a non-zero curl exit code.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.