AnswerDotAI / AnswerDotAI/nbdev
nbdev_test having issues because of Python caching modules
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 5.3k
- Forks
- 514
- Ø Merge
- 2 T. 30 Min.
- Gemergte PRs (30 T.)
- 8
Beschreibung
No need to add example as the explanation of the issue is simple.
nbdev_test uses up to 8 workers (threads) to run the tests, if we have a library called new_lib for example that its __init__ file has some global variables in it, if we have more than 8 tests, there will be a worker that will run more than one test, and because all the tests do import new_lib, that worker that runs more than one test won't import new_lib again and give the new test a fresh new environment as new_lib is already in sys.modules so because of Python caching modules it won't be imported again.
you should do something that refreshes workers before assigning them new tests
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne am nbdev_test-Einstiegspunkt und verfolge, wie seine Testzuweisungen an bis zu acht Worker verwaltet werden. Reproduziere das Problem mit mehr als acht Tests, die ein Modul mit globalem Zustand importieren; abgeschlossen ist die Aufgabe, wenn ein Worker den Zustand seines importierten Moduls aktualisiert, bevor er einen weiteren Test erhält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- testing
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100