Skip to content

Conversation

@Nodonisko
Copy link
Contributor

Description

Previously only some tests called destroyEngine method after each test and that caused that tests actually relied on running in order etc. Now each tests destroys engine instance so it's much more stable.

I still have one more failing test but maybe I should just update that fixture? I am not sure.

Screenshot 2025-08-29 at 15 15 42

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@Nodonisko Nodonisko requested a review from a team as a code owner August 29, 2025 13:17
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@sethkfman sethkfman added the area-performance Issues relating to slowness of app, cpu usage, and/or blank screens. label Sep 2, 2025
@tommasini
Copy link
Contributor

tommasini commented Sep 8, 2025

hey @Nodonisko I think you've just found a bug, that initializing the AccountTrackerController with an empty state, it's not allowing it to initialize as it intends to do IMO. I will double check that, but doesn't make sense to me the default state be an empty object instead of getting the network from Network Controller

@Nodonisko
Copy link
Contributor Author

@tommasini Thanks for feedback, so correct fix would to put some default network there instead of empty object?

@tommasini
Copy link
Contributor

@Nodonisko The team responsible for addressing the issue was notified, feel free to address the test to the expected behaviour for now accountsByChainId: {}!
Thanks Nodonisko!

cc: @salimtb

@sethkfman sethkfman added No QA Needed Apply this label when your PR does not need any QA effort. Run Smoke E2E Requires smoke E2E testing labels Sep 9, 2025
@Cal-L
Copy link
Contributor

Cal-L commented Sep 9, 2025

@Nodonisko Thanks for looking into this. Just bouncing thoughts on your question about the failing unit test for non matching AccountTrackerController data - I'm looking at the controller repo code and by default, the state should resemble the expected state that the test is showing. I would consider this a real test failure if that is being overridden to an empty object. @tommasini It looks like that data is just being wiped right?

@tommasini
Copy link
Contributor

Yeah, it seems that when I'm running the unit test on latest main right now, locally, I have the same error. I've talked with @salimtb and @salimtb confirmed that the initialization of AccountsTrackerController is wrong, and will fix it. The issue is here

I was suggesting to change the unit test since it's actually showing the actual result that is happening right now in Engine, because we are overriding if initial state is undefined

@Nodonisko
Copy link
Contributor Author

@tommasini I hotfixed that failing test

@owencraston owencraston added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Sep 10, 2025
@sethkfman sethkfman changed the base branch from main to chore/improve-engine-tests-margelo September 10, 2025 17:04
@sethkfman sethkfman merged commit 1b03190 into MetaMask:chore/improve-engine-tests-margelo Sep 10, 2025
83 of 93 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-performance Issues relating to slowness of app, cpu usage, and/or blank screens. external-contributor No QA Needed Apply this label when your PR does not need any QA effort. Run Smoke E2E Requires smoke E2E testing skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants