https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-father-404

11/01/2021, 8:43 PM
Copy code
______ TestPantsDaemonIntegration.test_pantsd_invalidation_file_tracking _______
277

278
self = <pants_test.pantsd.pantsd_integration_test.TestPantsDaemonIntegration testMethod=test_pantsd_invalidation_file_tracking>
279

280
    def test_pantsd_invalidation_file_tracking(self):
281
        test_dir = "testprojects/src/python/print_env"
282
        config = {"GLOBAL": {"pantsd_invalidation_globs": f'["{test_dir}/*"]'}}
283
        with self.pantsd_successful_run_context(extra_config=config) as ctx:
284
            ctx.runner(["help"])
285
            ctx.checker.assert_started()
286
    
287
            # Let any fs events quiesce.
288
            time.sleep(5)
289
            ctx.checker.assert_running()
290
    
291
            def full_pants_log():
292
                return "\n".join(read_pants_log(ctx.workdir))
293
    
294
            # Create a new file in test_dir
295
            with temporary_file(suffix=".py", binary_mode=False, root_dir=test_dir) as temp_f:
296
                temp_f.write("import that\n")
297
                temp_f.close()
298
    
299
>               ctx.checker.assert_stopped()
300

301
tests/python/pants_test/pantsd/pantsd_integration_test.py:363: 
302
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
303
tests/python/pants_test/pantsd/pantsd_integration_test_base.py:133: in assert_stopped
304
    for _ in attempts("pantsd should be stopped!"):
305
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
306

307
msg = 'pantsd should be stopped!'
308

309
    def attempts(
310
        msg: str,
311
        *,
312
        delay: float = 0.5,
313
        timeout: float = 30,
314
        backoff: float = 1.2,
315
    ) -> Iterator[None]:
316
        """A generator that yields a number of times before failing.
317
    
318
        A caller should break out of a loop on the generator in order to succeed.
319
        """
320
        count = 0
321
        deadline = time.time() + timeout
322
        while time.time() < deadline:
323
            count += 1
324
            yield
325
            time.sleep(delay)
326
            delay *= backoff
327
>       raise AssertionError(f"After {count} attempts in {timeout} seconds: {msg}")
328
E       AssertionError: After 15 attempts in 30 seconds: pantsd should be stopped!
329

330
tests/python/pants_test/pantsd/pantsd_integration_test_base.py:55: AssertionError
331
----------------------------- Captured stdout call -----------------------------
332

333
pantsd log is /tmp/process-executionate6je/tmpo4xpvo1h/.workdir.pants.d/pantsd/pantsd.log
334
>>> config: 
335
{'GLOBAL': {'pantsd': True, 'level': 'info', 'pants_subprocessdir': '/tmp/process-executionate6je/tmpo4xpvo1h/.pids', 'backend_packages': ['pants.backend.python', 'pants.backend.python.lint.flake8'], 'pantsd_invalidation_globs': '["testprojects/src/python/print_env/*"]'}}
336

337

338
running: ./pants help (config={'GLOBAL': {'pantsd': True, 'level': 'info', 'pants_subprocessdir': '/tmp/process-executionate6je/tmpo4xpvo1h/.pids', 'backend_packages': ['pants.backend.python', 'pants.backend.python.lint.flake8'], 'pantsd_invalidation_globs': '["testprojects/src/python/print_env/*"]'}}) (extra_env=None)
339

340
completed in 4.456297874450684 seconds
341
PantsDaemonMonitor: pid is 2976 is_alive=True
342
PantsDaemonMonitor: pid is 2976 is_alive=True
343
PantsDaemonMonitor: pid is 2976 is_alive=True
344
===============================================================
345
- BEGIN pants.log ---------------------------------------------
346
===============================================================
347
19:42:18.17 [INFO] handling request: `--no-pantsrc --pants-workdir=/tmp/process-executionate6je/tmpo4xpvo1h/.workdir.pants.d --print-stacktrace=True --pants-config-files=[] --pants-config-files=/tmp/process-executionate6je/tmpo4xpvo1h/.workdir.pants.d/pants.toml help`
348
19:42:19.27 [INFO] request completed: `--no-pantsrc --pants-workdir=/tmp/process-executionate6je/tmpo4xpvo1h/.workdir.pants.d --print-stacktrace=True --pants-config-files=[] --pants-config-files=/tmp/process-executionate6je/tmpo4xpvo1h/.workdir.pants.d/pants.toml help`
349
19:42:24.55 [INFO] notify invalidation: cleared 1 and dirtied 2 nodes for: {"testprojects/src/python/print_env", "testprojects/src/python/print_env/tmprs72jfw8.py"}
350
19:42:24.55 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"testprojects/src/python/print_env/tmprs72jfw8.py", "testprojects/src/python/print_env"}
351
19:42:24.55 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"testprojects/src/python/print_env", "testprojects/src/python/print_env/tmprs72jfw8.py"}
352
19:42:24.55 [INFO] Filesystem changed during run: retrying `PySnapshot` in 500ms...
353
19:43:00.61 [INFO] notify invalidation: cleared 2 and dirtied 2 nodes for: {"testprojects/src/python/print_env", "testprojects/src/python/print_env/tmprs72jfw8.py"}
354
19:43:00.61 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"testprojects/src/python/print_env", "testprojects/src/python/print_env/tmprs72jfw8.py"}
355
19:43:00.61 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"testprojects/src/python/print_env", "testprojects/src/python/print_env/tmprs72jfw8.py"}
356
===============================================================
357
- END pants.log -----------------------------------------------
358
===============================================================
359
- generated xml file: /tmp/process-executionate6je/tests.python.pants_test.pantsd.pantsd_integration_test.py.pantsd_integration.xml -
360

361

362
=========================== short test summary info ============================
363
FAILED tests/python/pants_test/pantsd/pantsd_integration_test.py::TestPantsDaemonIntegration::test_pantsd_invalidation_file_tracking
364
============= 1 failed, 23 passed, 3 skipped in 297.23s (0:04:57) ==============
365