Title: test_pickle/test_pickletools fail when running tests sequentially. · Issue #103247 · python/cpython · GitHub
Open Graph Title: test_pickle/test_pickletools fail when running tests sequentially. · Issue #103247 · python/cpython
X Title: test_pickle/test_pickletools fail when running tests sequentially. · Issue #103247 · python/cpython
Description: When running the test suite sequentially (as is done as part of the release process), an interaction between test_imp, test_importlib and subinterpreters is causing test_pickle and test_pickletools to fail. The easiest reproducer:: % ./p...
Open Graph Description: When running the test suite sequentially (as is done as part of the release process), an interaction between test_imp, test_importlib and subinterpreters is causing test_pickle and test_pickletools...
X Description: When running the test suite sequentially (as is done as part of the release process), an interaction between test_imp, test_importlib and subinterpreters is causing test_pickle and test_pickletools...
Opengraph URL: https://github.com/python/cpython/issues/103247
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_pickle/test_pickletools fail when running tests sequentially.","articleBody":"When running the test suite sequentially (as is done as part of the release process), an interaction between test_imp, test_importlib and subinterpreters is causing test_pickle and test_pickletools to fail. The easiest reproducer::\r\n\r\n```\r\n% ./python -m test test_imp test_importlib test_pickletools\r\n0:00:00 load avg: 0.22 Run tests sequentially\r\n0:00:00 load avg: 0.22 [1/3] test_imp\r\n0:00:00 load avg: 0.22 [2/3] test_importlib\r\n0:00:03 load avg: 0.22 [3/3] test_pickletools\r\ntest test_pickletools failed -- Traceback (most recent call last):\r\n File \"Lib/test/pickletester.py\", line 1989, in test_builtin_types\r\n s = self.dumps(t, proto)\r\n ^^^^^^^^^^^^^^^^^^^^\r\n File \"Lib/test/test_pickletools.py\", line 11, in dumps\r\n return pickletools.optimize(pickle.dumps(arg, proto, **kwargs))\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n_pickle.PicklingError: Can't pickle \u003cclass 'importlib._bootstrap.BuiltinImporter'\u003e: it's not the same object as importlib._bootstrap.BuiltinImporter\r\n\r\ntest_pickletools failed (1 error)\r\n\r\n== Tests result: FAILURE ==\r\n\r\n2 tests OK.\r\n\r\n1 test failed:\r\n test_pickletools\r\n\r\nTotal duration: 4.2 sec\r\nTests result: FAILURE\r\n```\r\n \r\nThe failure happens in both test_pickle and test_pickletools (test_pickletools's traceback is more obvious), after _in the same process_ running both test_imp and either test_import or test_importlib. Disabling `test_imp.ImportTests.test_create_builtin_subinterp()` makes the tests pass. (This was happening before #102982 as well as after it, so I don't think it is involved here.)\r\n\r\nI expect this is an unintentional side-effect of the test, but this was _not_ happening in the 3.12.0a6 release, and as far as I can tell the relevant tests haven't changed since before a6. I'm delaying the 3.12.0a7 release until it's clear this isn't a fundamental problem with subinterpreters.\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-104186\n* gh-104226\n* gh-104345\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/Yhg1s","@type":"Person","name":"Yhg1s"},"datePublished":"2023-04-04T14:49:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/103247/cpython/issues/103247"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7cf63692-0850-d7b1-4a78-5b9917e7c40e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A1FC:16B518:C5A63E:10CAD7A:69693809 |
| html-safe-nonce | 16e512583596864cbd90038d324de0d06305759fff12c2c0303ff31a47132080 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUZDOjE2QjUxODpDNUE2M0U6MTBDQUQ3QTo2OTY5MzgwOSIsInZpc2l0b3JfaWQiOiIxMjI3Mzc3NzY2NjMzNjUwMTg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f1268d0ee35964a60cb89ff2dd9ae91cb0afc131b96e6f06ff8e14cec1d5ee15 |
| hovercard-subject-tag | issue:1654043121 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/103247/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d099f41b062a4e51a5414b394bcadd6e66e94c432d0f75fdf1c6da06ec8118f3/python/cpython/issues/103247 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d099f41b062a4e51a5414b394bcadd6e66e94c432d0f75fdf1c6da06ec8118f3/python/cpython/issues/103247 |
| og:image:alt | When running the test suite sequentially (as is done as part of the release process), an interaction between test_imp, test_importlib and subinterpreters is causing test_pickle and test_pickletools... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Yhg1s |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width