-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: Fix bug where task logs would suddenly switch to another task's logs #8833
Conversation
Ember Asset Size actionAs of 3147d5c Files that got Bigger 🚨:
Files that stayed the same size 🤷:
|
Ember Test Audit comparison
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, nice sleuthing!! 😯
UI: Fix bug where task logs would suddenly switch to another task's logs
I believe this test became flaky after #8833, you can see an example failure here: https://app.circleci.com/pipelines/github/hashicorp/nomad/11809/workflows/0dc3c8f4-187c-44af-8bdb-6f010d653081/jobs/100848 My understanding of the goal here is not to assert that the first task group in the server database matches the first row displayed, but that before #8833 it could be assumed that they did match. This changes to find the row corresponding to the first server task group instead of assuming it’ll be first.
I believe this test became flaky after #8833, you can see an example failure here: https://app.circleci.com/pipelines/github/hashicorp/nomad/11809/workflows/0dc3c8f4-187c-44af-8bdb-6f010d653081/jobs/100848 The goal here is not to assert that the first task group in the server database matches the first row displayed, but before #8833 it could be assumed that they did match. This changes to find the row corresponding to the first server task group instead of assuming it’ll be first.
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fixes #8545
Issue
When streaming logs for a task, the logs will suddenly flip to the logs of a different task for the allocation. When this happens, the entire log output is flipped.
Reproduction
Root cause
A few things are important to know to understand the root cause.
TaskStates
in the API response are amap[string]interface{}
that get converted to an array of objects in the UISo what happens is when the allocation is reloaded, the API response is normalized and pushed into the Ember Data store. When the
TaskStates
are converted to an array, the order of tasks aren't stable. So when tasks switch places in the array, their respective records in the store are updated as if they are the other. This causesTask2
to becomeTask1
and vice versa.Fixing it is simple, just sort the keys when converting objects to arrays to ensure stable model fragments.
Job for Reproduction