Skip to content
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

Fix bug in tgt caching #11

Merged
merged 1 commit into from Aug 25, 2015
Merged

Fix bug in tgt caching #11

merged 1 commit into from Aug 25, 2015

Conversation

rranelli
Copy link
Contributor

This commit fixes a bug in the caching mechanism at
Cassette::Client#st_with_retry introduced at 183e1e5.

As you can see, in our testing suite we have no tests for caching:

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Cassette::Authentication::Cache
     # Not yet implemented
     # ./spec/cassette/authentication/cache_spec.rb:7

  2) Cassette::Client::Cache
     # Not yet implemented
     # ./spec/cassette/client/cache_spec.rb:6

That's probably why the bug slipped through our refactoring.

Before this fix:

irb(main):001:0> Cassette::Client.st_for('hodor')
fetching from tgt source
fetching from st source
=> "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"
irb(main):002:0> Cassette::Client.st_for('hodor')
fetching from tgt source
fetching from st source
=> "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"
irb(main):003:0> Cassette::Client.st_for('hodor')
fetching from tgt source
fetching from st source
=> "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"

Which reads: "every time we call #st_for we are fetching a new tgt and
st tickets."

After this fix:

irb(main):001:0> Cassette::Client.st_for('hodor')
fetching from tgt source
fetching from st source
=> "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"
irb(main):002:0> Cassette::Client.st_for('hodor')
=> "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"
irb(main):003:0> Cassette::Client.st_for('hodor')

Which reads: we are not messing everything up with lame refactorings.

This commit fixes a bug in the caching mechanism at
`Cassette::Client#st_with_retry` introduced at 183e1e5.

As you can see, in our testing suite we have no tests for caching:

```
Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Cassette::Authentication::Cache
     # Not yet implemented
     # ./spec/cassette/authentication/cache_spec.rb:7

  2) Cassette::Client::Cache
     # Not yet implemented
     # ./spec/cassette/client/cache_spec.rb:6
```

That's probably why the bug slipped through our refactoring.

Before this fix:

    irb(main):001:0> Cassette::Client.st_for('hodor')
    fetching from tgt source
    fetching from st source
    => "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"
    irb(main):002:0> Cassette::Client.st_for('hodor')
    fetching from tgt source
    fetching from st source
    => "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"
    irb(main):003:0> Cassette::Client.st_for('hodor')
    fetching from tgt source
    fetching from st source
    => "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"

Which reads: "every time we call #st_for we are fetching a new tgt and
st tickets."

After this fix:

    irb(main):001:0> Cassette::Client.st_for('hodor')
    fetching from tgt source
    fetching from st source
    => "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"
    irb(main):002:0> Cassette::Client.st_for('hodor')
    => "ST-25146147-Ethe5cFv2vSdZQBI0j3u-moe"
    irb(main):003:0> Cassette::Client.st_for('hodor')

Which reads: we are not messing everything up with lame refactorings.
rhruiz added a commit that referenced this pull request Aug 25, 2015
@rhruiz rhruiz merged commit 1742b33 into locaweb:master Aug 25, 2015
@andrerocker
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants