Skip to content
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

#containers-filter loses focus in testPods #1450

Open
martinpitt opened this issue Oct 12, 2023 · 1 comment
Open

#containers-filter loses focus in testPods #1450

martinpitt opened this issue Oct 12, 2023 · 1 comment
Labels
flake unstable test

Comments

@martinpitt
Copy link
Member

          Okay, so this still [reproduces](https://cockpit-logs.us-east-1.linodeobjects.com/pull-1356-20231012-051759-852fe880-debian-stable/log.html) [very](https://cockpit-logs.us-east-1.linodeobjects.com/pull-1356-20231012-051759-852fe880-fedora-38/log.html#30-2) [well](https://cockpit-logs.us-east-1.linodeobjects.com/pull-1356-20231012-051759-852fe880-fedora-39/log.html) on our infrastructure, it's especially pronounced on [/devel](https://cockpit-logs.us-east-1.linodeobjects.com/pull-1356-20231012-051759-852fe880-fedora-38-devel/log.html#26-2). Curiously, it [passed with firefox](https://cockpit-logs.us-east-1.linodeobjects.com/pull-1356-20231012-051933-852fe880-fedora-38-firefox/log.html), but TF runs firefox.

It sometimes reproduces locally with test/common/run-tests -j4 TestApplication.testPods{,2,3,4,5,6,7,8,9,10}. I cannot repro it on a bot when running the test in a loop. 🤯

Continuing from #1324 (comment) , it is still true that there are no podman events during this operation, although of course the log ordering is not very reliable. This also shows when ContainerHeader() gets-re-rendered; that does not happen in between the focus and key input, but it does get re-rendered again afterwards with the old value:

 log: XXX render ContainerHeader user admin twoOwners true ownerFilter all textFilter test-pod-1-system
<- {'type': 'undefined'}
-> wait: ph_is_present("#containers-filter:not([disabled]):not([aria-disabled=true])")
<- {'type': 'undefined'}
-> wait: ph_is_visible("#containers-filter:not([disabled]):not([aria-disabled=true])")
<- {'type': 'undefined'}
-> ph_focus("#containers-filter")
<- {'type': 'undefined'}
-> Input.dispatchKeyEvent({"type": "keyDown", "modifiers": 2, "text": "a", "windowsVirtualKeyCode": 65})
<- {}
-> Input.dispatchKeyEvent({"type": "keyUp", "modifiers": 2, "text": "a", "windowsVirtualKeyCode": 65})
<- {}
-> Input.dispatchKeyEvent({"type": "keyDown", "modifiers": 0, "text": "\b", "windowsVirtualKeyCode": 8})
<- {}
-> Input.dispatchKeyEvent({"type": "keyUp", "modifiers": 0, "text": "\b", "windowsVirtualKeyCode": 8})
<- {}
-> wait: ph_is_present("#containers-filter:not([disabled]):not([aria-disabled=true])")
> debug: podman system call 47 result: "[]\n"
<- {'type': 'undefined'}
-> wait: ph_is_visible("#containers-filter:not([disabled]):not([aria-disabled=true])")
> debug: podman system call 50 error: {"status":404,"reason":"Not Found","message":"Not Found","problem":null} content "{\"cause\":\"no such container\",\"message\":\"no container with name or ID \\\"96bd46d7e2110e6dc938c1086d93a292f02652b8b43de68c25d30dee54762143\\\" found: no such container\",\"response\":404}\n"
> debug: podman system call 48 result: "[]\n"
> log: 
> debug: podman system call 51: {"method":"GET","path":"/v1.12/libpod/containers/96bd46d7e2110e6dc938c1086d93a292f02652b8b43de68c25d30dee54762143/json","body":"","params":{"size":false}}
> debug: podman system call 49 result: "[]\n"
<- {'type': 'undefined'}
-> ph_blur("#containers-filter")
<- {'type': 'undefined'}
-> wait: ph_is_present("#containers-filter")
> debug: podman system call 46 result: "{\"RemovedCtrs\":{\"96bd46d7e2110e6dc938c1086d93a292f02652b8b43de68c25d30dee54762143\":null},\"Err\":null,\"Id\":\"22a53193294a0031c001f8ae19d260662d7e5357a5dc9cc4ab56a8158c54412d\"}\n"
<- {'type': 'undefined'}
-> wait: ph_is_visible("#containers-filter")
<- {'type': 'undefined'}
-> wait: ph_has_val("#containers-filter","")
> debug: podman system call 51 error: {"status":404,"reason":"Not Found","message":"Not Found","problem":null} content "{\"cause\":\"no such container\",\"message\":\"no container with name or ID \\\"96bd46d7e2110e6dc938c1086d93a292f02652b8b43de68c25d30dee54762143\\\" found: no such container\",\"response\":404}\n"
> log: 
> debug: podman system monitor {"status":"remove","id":"22a53193294a0031c001f8ae19d260662d7e5357a5dc9cc4ab56a8158c54412d","Type":"pod","Action":"remove","Actor":{"ID":"22a53193294a0031c001f8ae19d260662d7e5357a5dc9cc4ab56a8158c54412d","Attributes":{"containerExitCode":"0","image":"","name":"pod-1","podId":""}},"scope":"local","time":1697093311,"timeNano":1697093311385143777}
> log: XXX render ContainerHeader user admin twoOwners true ownerFilter all textFilter test-pod-1-system

With the confirm focus patch the test fails on that then:

<- {'type': 'undefined'}
-> wait: ph_is_present("#containers-filter:not([disabled]):not([aria-disabled=true])")
<- {'type': 'undefined'}
-> wait: ph_is_visible("#containers-filter:not([disabled]):not([aria-disabled=true])")
<- {'type': 'undefined'}
-> ph_focus("#containers-filter")
<- {'type': 'undefined'}
-> wait: document.activeElement == document.querySelector("#containers-filter")
[...]
wait_js_cond(document.activeElement == document.querySelector("#containers-filter")): Uncaught (in promise) Error: condition did not become true

So indeed the ph_focus() went into Nirvana.

Originally posted by @martinpitt in #1356 (comment)

@martinpitt
Copy link
Member Author

PR #1356 adds a horrible hack for this, but we are still none the wiser for the root cause. See the debugging in #1356 and #1324 (comment) for the debugging history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flake unstable test
Projects
None yet
Development

No branches or pull requests

1 participant