code: def _update_process_check(canvas, val, draw=True):
      """Update, process, and check result"""
      if draw:
          canvas.update()
          canvas.app.process_events()
          canvas.app.process_events()
          sleep(0.03)  # give it time to swap (Qt?)
      canvas._backend._vispy_set_current()
      print("           check %s" % val)
      # check screenshot to see if it's all one color
      ss = _screenshot()
      try:
          assert_allclose(ss.shape[:2], _win_size[::-1])
      except Exception:
          print("!!!!!!!!!! FAIL  bad size %s" % list(ss.shape[:2]))
          raise
      goal = val * np.ones(ss.shape)
      try:
          # Get rid of the alpha value before testing
          # It can be off by 1 due to rounding
          assert_allclose(ss[:, :, :3], goal[:, :, :3], atol=1)
      except Exception:
          print("!!!!!!!!!! FAIL  %s" % np.unique(ss))
          raise
  
file_path: vispy/vispy/app/tests/test_simultaneous.py
imports: import sys
  from time import sleep
  import pytest
  import numpy
  from numpy.testing import assert_allclose
  from vispy.app import use_app, Canvas, Timer
  from vispy.testing import requires_application, SkipTest, run_tests_if_main, IS_TRAVIS_CI
  from vispy.util.ptime import time
  from vispy.gloo import gl
  from vispy.gloo.util import _screenshot
label_desc: Use image node_id 1 for calling a global function with example usage: _update_process_check(canvas, val, draw) without return types