SerializationTests::Actions started failing recently #17739

Closed
opened 2026-01-31 05:51:55 +00:00 by claunia · 3 comments
Owner

Originally created by @j4james on GitHub (Jun 18, 2022).

Originally assigned to: @zadjii-msft on GitHub.

Windows Terminal version

Commit 848314ef17

Windows build number

10.0.19044.1706

Other Software

No response

Steps to reproduce

  1. Build a recent commit of OpenConsole (I think anything after 799b5d4add should do).
  2. Run the unit tests.

Expected Behavior

All the tests should pass.

Actual Behavior

There is a failure in SettingsModelLocalTests::SerializationTests::Actions when attempting to serialize the pair of findMatch actions. It seems that the commands are being reordered.

Click to see error
Error: Verify: AreEqual(toString(json), toString(result)) - Values ([
        {
                "command" :
                {
                        "action" : "findMatch",
                        "direction" : "next"
                },
                "keys" : "ctrl+shift+s"
        },
        {
                "command" :
                {
                        "action" : "findMatch",
                        "direction" : "prev"
                },
                "keys" : "ctrl+shift+r"
        }
], [
        {
                "command" :
                {
                        "action" : "findMatch",
                        "direction" : "prev"
                },
                "keys" : "ctrl+shift+r"
        },
        {
                "command" :
                {
                        "action" : "findMatch",
                        "direction" : "next"
                },
                "keys" : "ctrl+shift+s"
        }
])

I'm not sure if this is actually an indication of a bug - is the order of the commands expected to be retained? But at the very least I'd expect the test to be corrected if this is just an altered hash map order or something of that sort.

If it helps, I think the first time the test stopped working was after commit 799b5d4add.

Originally created by @j4james on GitHub (Jun 18, 2022). Originally assigned to: @zadjii-msft on GitHub. ### Windows Terminal version Commit 848314ef17419430153561016d1fabe912338844 ### Windows build number 10.0.19044.1706 ### Other Software _No response_ ### Steps to reproduce 1. Build a recent commit of OpenConsole (I think anything after 799b5d4add799ac2fbf5c855b774cd7dcb957697 should do). 2. Run the unit tests. ### Expected Behavior All the tests should pass. ### Actual Behavior There is a failure in `SettingsModelLocalTests::SerializationTests::Actions` when attempting to serialize the pair of `findMatch` actions. It seems that the commands are being reordered. <details> <summary>Click to see error</summary> ``` Error: Verify: AreEqual(toString(json), toString(result)) - Values ([ { "command" : { "action" : "findMatch", "direction" : "next" }, "keys" : "ctrl+shift+s" }, { "command" : { "action" : "findMatch", "direction" : "prev" }, "keys" : "ctrl+shift+r" } ], [ { "command" : { "action" : "findMatch", "direction" : "prev" }, "keys" : "ctrl+shift+r" }, { "command" : { "action" : "findMatch", "direction" : "next" }, "keys" : "ctrl+shift+s" } ]) ``` </details> I'm not sure if this is actually an indication of a bug - is the order of the commands expected to be retained? But at the very least I'd expect the test to be corrected if this is just an altered hash map order or something of that sort. If it helps, I think the first time the test stopped working was after commit 799b5d4add799ac2fbf5c855b774cd7dcb957697.
Author
Owner

@zadjii-msft commented on GitHub (Jun 20, 2022):

If it helps, I think the first time the test stopped working was after commit 799b5d4add.

That's w e i r d, Cause, that shouldn't really affect this at all 🙃

I don't think the order really matters at all tbh, string comparing the json was just a shortcut vs having to actually re-parse and structurally analyze for equality. Let's just swap the order around (if it's seemingly stable in the new order)

@zadjii-msft commented on GitHub (Jun 20, 2022): > If it helps, I think the first time the test stopped working was after commit https://github.com/microsoft/terminal/commit/799b5d4add799ac2fbf5c855b774cd7dcb957697. That's w e i r d, Cause, that shouldn't really affect this at all 🙃 I don't think the order really matters at all tbh, string comparing the json was just a shortcut vs having to actually re-parse and structurally analyze for equality. Let's just swap the order around (if it's seemingly stable in the new order)
Author
Owner

@zadjii-msft commented on GitHub (Jun 20, 2022):

I've got a fix in, well... 5a40e8061 I think. I think I accidentally did a git add --all there, so it's a bit tangled with other prototypes. I'll submit the PR tomorrow.

@zadjii-msft commented on GitHub (Jun 20, 2022): I've got a fix in, well... 5a40e8061 I think. I think I accidentally did a `git add --all` there, so it's a bit tangled with other prototypes. I'll submit the PR tomorrow.
Author
Owner

@zadjii-msft commented on GitHub (Jul 5, 2022):

Note to self: dev/migrie/b/12788-did-it-work. That's the branch where I tried to do the CI changes that really did not work.

@zadjii-msft commented on GitHub (Jul 5, 2022): Note to self: `dev/migrie/b/12788-did-it-work`. That's the branch where I tried to do the CI changes that _really_ did not work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17739