Skip to content

Commit

Permalink
Fix keys leaked in TimeSeries spec
Browse files Browse the repository at this point in the history
Forgot to clean up after this. Usually the `test` macro handles this,
but we needed 2 keys here and that macro only supplies 1, so we had to
do this manually.
  • Loading branch information
jgaskins committed Nov 15, 2023
1 parent 7797b24 commit 6c96312
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions spec/time_series_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,19 @@ module Redis
it "gets the index names for a given filter" do
included_key = UUID.random.to_s
excluded_key = UUID.random.to_s
name_label = UUID.random.to_s
redis.ts.create included_key, labels: { "name" => name_label, }
redis.ts.create excluded_key, labels: { "name" => UUID.random.to_s, }

names = redis.ts.queryindex("name=#{name_label}").as(Array)
begin
name_label = UUID.random.to_s
redis.ts.create included_key, labels: {"name" => name_label}
redis.ts.create excluded_key, labels: {"name" => UUID.random.to_s}

names.should contain included_key
names.should_not contain excluded_key
names = redis.ts.queryindex("name=#{name_label}").as(Array)

names.should contain included_key
names.should_not contain excluded_key
ensure
redis.unlink included_key, excluded_key
end
end
end
end

0 comments on commit 6c96312

Please sign in to comment.