Skip to content

Test failure: SseTest.testPublisherString_EE8_FEATURES_MicroProfile_40 #33559

@neenapj

Description

@neenapj

This bug might get resolved if we upgrade Apache CXF for EE8. We are still on 3.5.5 but CXF has moved up to 3.5.11.

Details:
SseClientTestServlet.testPublisherString_EE8_FEATURES_MicroProfile_40 is failing only in EE8.
It could be replicated by by changing Thread.sleep(100) to Thread.sleep(10) in SseResource class (line 42 & 46). This test method will pass only if it is ran as the first test method. It is failing when any other test method in SseTest is ran before this. Another test method in the same class testPublisherInboundSseEvent( )is always passing (any order) even though it is also using the same url as testPublisherString() (/send3strings) . Only difference between both tests is the type parameter of Subscriber. In testPublisherString, it is String and for testPublisherInboundSseEvent() it is InboundSseEvent. So I suspect whether it is due to any bug in Apache CXF's SseTypeSafeSubscription in the EE8 for String type? This issue is not happening in EE11.

A duplicate event is happening during this testPublisherString() run. Sharing below the expected and actual behaviour.
Expected behavior (3 events):
Latch initialized to 4 (3 events + 1 for onComplete)
onNext called 3 times → latch goes from 4 → 3 → 2 → 1
onComplete called → latch goes from 1 → 0
Test proceeds after latch reaches 0

Actual behavior (4 events due to duplicate):
Latch initialized to 4
onNext called 4 times → latch goes from 4 → 3 → 2 → 1 → 0 ← Reaches 0 on 4th onNext!
Test thread wakes up and checks onCompleteCalled → FALSE (onComplete hasn't been called yet)
Test fails with "onComplete not called"
onComplete is called immediately after → too late, test already failed

Note: Currently this test is skipped for EE8. Make sure to uncomment it once this upgrade is done

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