[11:08:17] lunch [11:54:15] https://phabricator.wikimedia.org/T380961 - it looks like there is a broken/corrupt document in the ttmserver index in production. Is there way for me to inspect/query the index to confirm and investigate further? [12:11:55] Nikerabbit: generically, you can query https://search.svc.{eqiad,codfw}.wmnet:9243/ttmserver to poke at the indices and see whats in there. Most generic request would be /ttmserver/_doc/ to fetch a single doc by id [12:14:09] ebernhardson: ty I'll try that [12:15:18] not seeing anything obvious, from the error i would have expected this query to return something but both clusters report 0 results: {"query":{"bool":{"must_not":[{"exists": {"field": "uri"}}]}}} [12:17:01] hmm weird... maybe I need to reverse engineer the actual query then [12:18:04] if it happened everywhere i might guess source filtering, which sets the columns to return, but since it normally works i'm not sure [12:25:45] ebernhardson: it seems my initial assumption is wrong. it's not faulty ttmserver index, it's mismatch on Translate's message index. Thanks for the help [14:35:39] o/ [15:08:57] randomly curious tool, kinda search-ish: https://wikiflix.toolforge.org/#/ [15:11:30] nice :) [15:12:34] surprisingly, we aparently host the videos for all of those movies (thats why they are all 1920's -ish) [15:15:13] oh ok [15:41:57] I think I simply I don't understand pytest-mock... :( [15:42:34] watch_mock = mocker.Mock(Watch) [15:42:34] lol, what about it? pytest-mock should mostly be a wrapper around stdlib unittest.mock to make it available in test cases and clean up between tests? [15:42:39] mocker.patch('kubernetes.watch.watch.Watch', new=watch_mock) [15:43:18] so I expect that when building a new Watch like "Watch()" I would get watch_mock instead [15:43:27] i suspect it's going to be a problem with where things are loaded from. Sadly, mocking depends on how the file uses a thing. [15:43:42] I mean, if the code has `from kubernetes.watch.watch import Watch` then your code above doesn't work [15:44:11] it seems to return something mocked thi [15:44:16] s/thi/tho [15:44:29] what i mean is, the `from .. import ..` creates a local variable in your module at import time, so mocking the Watch later doesn't work, as the reference is already copied [15:44:29] but doing watch_mock.stream.return_value = [ something ] [15:44:48] oh, hmm [15:45:19] I get TypeError: 'Mock' object is not iterable when call w.stream(...) where w = watch.Watch() [15:45:36] dcausse: oh, yea Mock's aren't iterable. Try MagicMock maybe? [15:45:50] MagicMock has the magic methods, __iter__ and such [15:46:06] but why w.stream() is not returning what I've set at: watch_mock.stream.return_value [15:46:14] oh, umm [15:46:49] I should upload the code somewhere probably... [15:47:00] yea i'm trying to ponder but not sure, code would probably help [15:52:24] meh... trying to cleanup imports it's now even worse... [15:55:03] was curious and opened the code for pytest-mock, it's more complicated than i expected :P [15:57:29] well it must be because it does crazy things :) [15:57:51] most of the crazyness is from unittest.mock, pytest-mock is just a wrapper [15:58:13] (and looks like it does some awkward things to re-create the unittest.mock api) [15:59:20] ebernhardson: https://gitlab.wikimedia.org/repos/search-platform/cirrus-reindex-orchestrator/-/blob/mwscript-k8s-support/tests/test_k8s.py?ref_type=heads#L57 [16:02:08] dcausse: and wait_until_pod_container is where the work happens? [16:03:09] Wednesday meeting on https://meet.google.com/eki-rafx-cxi [16:04:28] dcausse: ^ [16:05:53] sorry got distracted by the kids, joining [16:31:45] dcausse: mocker.patch("cirrus_reindexer.k8s.watch.Watch", new=watch_mock) [16:57:25] dcausse: https://phabricator.wikimedia.org/P71223 [17:56:04] dinner [19:03:14] hmm, didn't think that was possible. The dev-images repo has buster-php81-fpm:1.0.1-s3, but docker-registry.wikimedia.org only has up to s2