Skip to content

e2e_part2#179

Merged
AYAHASSAN287 merged 51 commits into
masterfrom
E2E_part2
May 11, 2026
Merged

e2e_part2#179
AYAHASSAN287 merged 51 commits into
masterfrom
E2E_part2

Conversation

@AYAHASSAN287
Copy link
Copy Markdown
Collaborator

@AYAHASSAN287 AYAHASSAN287 commented Apr 26, 2026

Summary

End-to-end test coverage for the wrapper send path, plus the supporting infrastructure (helpers, CI pipeline, store assertions). Adds 19 new scenarios across two files

Tests

tests/wrappers_tests/test_send_e2e_part1.py (TestSendBeforeRelay):

ID Scenario
S17 Send before any relay peer joins; positive/negative paths
S19 Store peer comes online after propagation — Sent fires once reachable
S20 Relay/lightpush propagation succeeds, store query initially misses, retry republishes and validates
S21 Delivery retry window expires before any valid path recovers
S22 Non-ephemeral message with reliabilityEnabled=False — Propagated only, no Sent
S23 Non-ephemeral, reliability enabled, no store peer reachable — Propagated only, no Sent, no terminal error
S24 Ephemeral message with reachable store peer — Propagated only, no store validation
S26 Lightpush peer churn — selected peer disappears, alternate remains, message still propagates
S30 Concurrent sends on the same content topic during initial auto-subscribe — unique request IDs, no cross-association
S31 Concurrent sends across mixed topics during 3-phase peer churn (before / during / after restart)

tests/wrappers_tests/test_send_e2e_part2.py:

ID Scenario
S02 Send without explicit subscribe — auto-subscribe on first send
S06 Core sender, relay only — propagation without store
S07 Core sender, relay + store — propagation with store validation
S08 Relay-to-lightpush fallback
S09 Relay-to-lightpush fallback with store validation
S10 Edge sender, lightpush only
S12 Isolated sender, no peers — error event
S14 Lightpush non-retryable error (oversized message)
S15 Lightpush retryable error then recovery

New helpers

  • src/node/wrapper_helpers.pyEventCollector (thread-safe async event sink), event-type predicates, wait_for_propagated/sent/error/connected, assert_event_invariants, get_node_multiaddr, create_message_bindings.
  • src/steps/store.pycheck_sent_message_is_stored to assert hashes are present in store.
  • src/node/wrappers_manager.pyget_node_info_raw (returns the unparsed string).

Infra / wiring

  • New .github/workflows/pr_tests.yml — build (cached on submodule hash) → wrapper tests → smoke; full 18-shard suite triggered by full-test label.

Known issues

  • S19 __ failing in the post-propagation reliability/store phase: the message is propagated, but the sender cannot complete store validation before the retry window expires although Store peer joins and is detected:``
    storeClientCount=1 issue
  • S31json_serialization/writer.nim → w.inObject() AssertionDefect and nwaku SIGSEGV during shutdown/churn. Note: flaky not show up always
  • S20 — when the store peer joins after the initial miss, the retry loop fails to republish: sender repeatedly logs NoPeersToPublish and eventually emits message_error: Unable to send within retry time window.
    note: the main point is that it's not possible to force the miss round
  • S08__ the test fails if lightpushnode not used issue

AYAHASSAN287 and others added 13 commits April 14, 2026 19:43
* - Add S06 relay-only test case for testing message propagation without a store.
- Update `wrapper_helpers` for clearer event type handling and type annotations (`Optional[...]` usage).
- Simplify `get_node_multiaddr` to retrieve addresses via `get_node_info_raw`.
- Refactor `wrappers_manager` to adjust bindings path to `vendor` directory and add `get_node_info_raw` method.
- Update `.gitignore` to exclude `store.sqlite3*`.

* Refactor S06 relay-only test: replace try-finally blocks with context managers for clarity and conciseness.

* Migrate S06 relay-only test to `test_send_e2e.py` and refactor with `StepsCommon` for reusability.

---------

Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
@AYAHASSAN287 AYAHASSAN287 changed the title E2 e part2 e2e_part2 Apr 26, 2026
AYAHASSAN287 and others added 5 commits April 27, 2026 10:42
… helper (#178)

- Refactored the `wait_for_event` function for clarity and to ensure proper deadline handling within the loop.
- Introduced `assert_event_invariants` to validate per-request event properties, enforcing invariants like correct `requestId`, no duplicate terminal events, and proper timing between `Propagated` and `Sent`.
- Added tests for `assert_event_invariants` enforcement in `S14` and `S15` lightpush scenarios.

Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
* Add `assert_event_invariants` to enforce per-request event constraints and integrate into relevant tests

* Integrate `assert_event_invariants` into edge and store tests

* Remove redundant comments from `test_send_e2e.py`

---------

Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
Copy link
Copy Markdown
Collaborator

@fbarbu15 fbarbu15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks but can you please add a full run test report to the PR description?

at0m1x19 and others added 8 commits April 30, 2026 16:15
* Add tests for auto-subscribe on first send and isolated sender with no peers

* Add PR CI workflow with tiered test strategy

- pr_tests.yml: build job with cache, wrapper-tests, smoke-tests,
  and label-triggered full-suite
- test_common.yml: add deploy_allure/send_discord inputs so PR runs
  skip reporting side effects
- Add docker_required marker to S19 (needs Docker, excluded from
  wrapper-only CI job)
- Register docker_required marker in pytest.ini

* Document PR CI test workflows in README

* Refine PR CI test strategy:
- Exclude `docker_required` tests from smoke set in `pr_tests.yml`.
- Add `wait_for_connected` helper for connection state checks.
- Update S19 test to dynamically create and clean up the store node setup.
- General simplifications and improved test stability.

* Add `wait_for_connected` assertion to ensure sender connection state before propagation test

* Refine tests and CI workflows:
- Replace `ERROR_TIMEOUT_S` with `ERROR_AFTER_CACHE_EXPIRY_TIMEOUT_S` in `test_send_e2e.py`.
- Adjust timeout assertion for better clarity and accuracy.
- Update `pr_tests.yml` to add retries (`--reruns`) and ignore wrapper tests in smoke tests.
- Change `test_common.yml` default Discord reporting to `false`.

* Normalize `portsshift` to `portsShift` in `test_send_e2e.py` configuration definitions.

---------

Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
Copy link
Copy Markdown
Contributor

@at0m1x19 at0m1x19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments — mostly suggestions, nothing blocking the overall direction. Thanks for the work on this!

Comment thread .github/workflows/pr_tests.yml Outdated
Comment thread tests/wrappers_tests/test_send_e2e_part2.py
Comment thread tests/wrappers_tests/test_send_e2e_part2.py Outdated
Comment thread src/node/wrapper_helpers.py
Copy link
Copy Markdown
Contributor

@at0m1x19 at0m1x19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up batch — a question on the xfail markers, a validated note on docker_required, and a couple of unused imports.

Comment thread tests/wrappers_tests/test_send_e2e_part1.py Outdated
Comment thread tests/wrappers_tests/test_send_e2e_part1.py
Comment thread tests/wrappers_tests/test_send_e2e_part1.py
Comment thread tests/wrappers_tests/test_send_e2e_part2.py Outdated
Copy link
Copy Markdown
Contributor

@at0m1x19 at0m1x19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final batch of part1 comments

Comment thread tests/wrappers_tests/test_send_e2e_part1.py Outdated
Comment thread tests/wrappers_tests/test_send_e2e_part1.py Outdated
Comment thread tests/wrappers_tests/test_send_e2e_part1.py
Comment thread tests/wrappers_tests/test_send_e2e_part1.py
Comment thread tests/wrappers_tests/test_send_e2e_part1.py
Comment thread tests/wrappers_tests/test_send_e2e_part1.py Outdated
Comment thread tests/wrappers_tests/test_send_e2e_part1.py
Comment thread tests/wrappers_tests/test_send_e2e_part1.py
@AYAHASSAN287
Copy link
Copy Markdown
Collaborator Author

LGTM, thanks but can you please add a full run test report to the PR description?

latest job
here is already 2 open bugs related to the open issues

@AYAHASSAN287 AYAHASSAN287 requested a review from at0m1x19 May 7, 2026 13:12
@AYAHASSAN287 AYAHASSAN287 requested a review from fbarbu15 May 11, 2026 11:23
@AYAHASSAN287
Copy link
Copy Markdown
Collaborator Author

LGTM, thanks but can you please add a full run test report to the PR description?

Latest run , all skipped tests failing for issues opened

@AYAHASSAN287 AYAHASSAN287 merged commit 11197db into master May 11, 2026
4 of 5 checks passed
@AYAHASSAN287 AYAHASSAN287 deleted the E2E_part2 branch May 11, 2026 13:53
Copy link
Copy Markdown
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late review. Just adding a few comments. Thanks!

Comment thread src/steps/store.py

logger.debug(f"messages length is {len(self.store_response.messages)}")
assert self.store_response.messages, f"Peer {node.image} couldn't find any messages. " f"Actual response: {self.store_response.resp_json}"
assert len(self.store_response.messages) >= len(expected_hashes), (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to assert strict equal?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real correctness check is the loop (assert expected_hash in actual_hashes)
Store state isn't isolated ,the store node can hold messages from prior store requests .

Comment on lines +158 to +160
"tcpPort": free_port(),
"discv5UdpPort": free_port(),
"restPort": free_port(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After having merged the following, it should be enough to pass 0 to these to perform auto-port internally. Maybe another test to consider in the future: logos-messaging/logos-delivery#3828

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add it in recent tests , add specific test for it

Comment on lines +361 to +364
"relay": True,
"store": False,
"lightpush": False,
"filter": False,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is interesting to only configure nodes by only touching the mode attribute, i.e., only setting either mode: "Edge" or mode: "Core". Even though nowadays is supported to manually set protocols, we aim for devs to not tweak that directly, in the future.
I mean, this is actually a flaw in the API, that should not accept those attributes, and we might fix that in the future.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered this in the recent PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants