code: def test_ci_move_from_passing_to_flaky():
      """
      Test the entire lifecycle of a CI test when it moves from passing to flaky.
      """
      test = Test(name="w00t", team="ci")
      # start from passing
      assert test.get_state() == TestState.PASSING
  
      # passing to flaky
      test.test_results = [
          TestResult.from_result(
              Result(status=ResultStatus.SUCCESS.value)
          ),
          TestResult.from_result(
              Result(status=ResultStatus.ERROR.value)
          ),
      ] * 10
      CITestStateMachine(test).move()
      assert test.get_state() == TestState.FLAKY
      issue = MockIssueDB.issue_db[
          test.get(Test.KEY_GITHUB_ISSUE_NUMBER)
      ]
      assert issue.state == "open"
      assert issue.title == "CI test w00t is flaky"
  
      # flaky to jail
      issue.edit(labels=[MockLabel(JAILED_TAG)])
      CITestStateMachine(test).move()
      assert test.get_state() == TestState.JAILED
      assert issue.comments[-1] == JAILED_MESSAGE
  
imports: import sys
  from typing import List, Optional
  import pytest
  from ray_release.test import Test, TestResult, TestState
  from ray_release.result import Result, ResultStatus
  from ray_release.test_automation.release_state_machine import ReleaseTestStateMachine
  from ray_release.test_automation.ci_state_machine import CITestStateMachine, CONTINUOUS_FAILURE_TO_FLAKY, CONTINUOUS_PASSING_TO_PASSING, FAILING_TO_FLAKY_MESSAGE, JAILED_TAG, JAILED_MESSAGE
  from ray_release.test_automation.state_machine import TestStateMachine
label_desc: Use image node_id 1 for calling a global function with example usage: test_ci_move_from_passing_to_flaky() without return types