Skip to content

Commit

Permalink
move sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Jan 9, 2024
1 parent 8033873 commit dc95cd7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spec/acceptance/tests/cache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require "yaml"
require_relative "../../spec_helper"

# note: these tests could be a bit flaky because they depend on the timing of the cache
# NOTE: these tests could be a bit flaky because they depend on the timing of the cache
describe "API calls to validate caching" do
before do
@config = YAML.safe_load_file("spec/acceptance/ldap-api/config/config.yml")
Expand All @@ -21,12 +21,11 @@
expect(response["Cache-Ttl"].to_i).to eq(@config["ldap"]["cache"]["ttl"])

# now make the exact same request and expect the TTL to be less the original TTL
sleep 1
response = Net::HTTP.start(uri.host, uri.port) do |http|
http.get(uri)
end

sleep 1

expect(response["Cache-Ttl"].to_i).to be < @config["ldap"]["cache"]["ttl"]
end
end

0 comments on commit dc95cd7

Please sign in to comment.