Skip to content

Commit

Permalink
Key deletion does not seem atomic.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Sep 13, 2024
1 parent ef5f5b3 commit fc4b130
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/cloudflare/kv/namespaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@
expect(namespace.read_value(key)).to be == value.to_s
expect(namespace.delete_value(key)).to be == true

fetched_namespace = account.kv_namespaces.find_by_id(namespace.id)

expect do
pp key: key, value: value, fetched_value: fetched_namespace.read_value(key)
end.to raise_exception(Cloudflare::RequestError)
# This doesn't always reliably fail, so we can't test it:
#
# fetched_namespace = account.kv_namespaces.find_by_id(namespace.id)
#
# expect do
# fetched_namespace.read_value(key)
# end.to raise_exception(Cloudflare::RequestError)
end

it "can get the keys that exist in the namespace" do
Expand Down

0 comments on commit fc4b130

Please sign in to comment.