You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
The test was failing intermittently with AssertionError: Expected: a value greater than <0L> but: <0L> was equal to <0L> due to a race condition between data processing completion and asynchronous datafeed timing stats persistence.
Root Cause:
Datafeed timing stats are persisted asynchronously. The test's single assertBusy() block checked both data processing completion AND timing stats simultaneously. Data processing could complete before timing stats persistence finished, causing search_count to still appear as 0.
Solution:
Split the assertion into two phases:
Phase 1: Wait for data processing to complete (processedRecordCount == numDocs)
Phase 2: Wait for timing stats to be persisted (search_count > 0)
This eliminates the race condition while maintaining the test's validation goals and testing realistic client-observable behavior.
Copy file name to clipboardExpand all lines: x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DatafeedJobsIT.java
0 commit comments