Skip to content

Completable.doOnDipose() not called when disposing with TestObserver #4872

@vanniktech

Description

@vanniktech

The following test case fails:

final AtomicBoolean atomicBoolean = new AtomicBoolean();

assertThat(atomicBoolean.get()).isFalse();

Completable.complete()
    .doOnDispose(() -> atomicBoolean.set(true))
    .test()
    .assertResult()
    .dispose();

assertThat(atomicBoolean.get()).isTrue(); // Fails

In my opinion this is a bit misleading and probably should not be the case. Is this working as intended?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions