AnswerDotAI / AnswerDotAI/nbdev
nbdev_test having issues because of Python caching modules
- Lingua principale
- Jupyter Notebook
- Stelle
- 5.3k
- Fork
- 513
- Merge medio
- 2g 30m
- PR unite (30g)
- 8
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dal punto di ingresso nbdev_test e segui come vengono gestite le assegnazioni dei test a un massimo di otto worker. Riproduci il problema con più di otto test che importano un modulo con stato globale; il lavoro è completato quando un worker aggiorna lo stato del modulo importato prima di ricevere un altro test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- testing
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100