Skip to content

Bug in getStateThenDelete test: Asserts deleted state is still returned #1408

Open
@iddeepak

Description

@iddeepak

I found a small issue in the DaprClientGrpcTest.getStateThenDelete test.

In this test, we first call getState("key2"), but we don’t block it yet (so it doesn't run immediately).

Then we call deleteState("key2") and block it — which means the delete happens right away.

After that, we finally block the earlier getState call. But by this time, the key has already been deleted. So it should not return the value — it should be null.

Right now, the test wrongly expects that getState will still return the original value, even though we already deleted it.


Current (wrong) code:

Mono<State<String>> resultGet2 = client.getState(STATE_STORE_NAME, keyRequest2, String.class);
assertEquals(expectedState2, resultGet2.block()); // ❌ wrong expectation

@salaboy @siri-varma

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions