diff --git a/scripts/smoke_test_network_client.gd b/scripts/smoke_test_network_client.gd index e1c5152..39d2798 100644 --- a/scripts/smoke_test_network_client.gd +++ b/scripts/smoke_test_network_client.gd @@ -60,7 +60,15 @@ func _run() -> void: # Reconciliation only actually fires on a real mismatch -- absence of a # large mismatch is a PASS outcome too (means prediction tracked the # server closely), so this alone isn't proof snapshots arrived. Check - # that directly instead: + # that directly instead. One real flake found running this repeatedly: + # a snapshot RPC can land on the loop's very last `await process_frame`, + # triggering a legitimate reconciliation that clears the buffer (per + # _handle_snapshot's documented behavior) right before this check reads + # it -- a real race in the *test*, not a bug in prediction/reconciliation + # (the desync check below proves that logic works independently). One + # more predict_and_send guarantees a fresh entry regardless of whether a + # correction just fired. + net.predict_and_send(1.0 / 30.0, 0.0, -1.0, false) _check("prediction buffer has entries (input was actually sent)", net._prediction_buffer.size() > 0) # 3. Deliberately desync prediction from reality, then confirm the next