<s> import zookeeper , zktestbase , unittest , threading <EOL> import time <EOL> class CloseDeadlockTest ( zktestbase . TestBase ) : <EOL> """<STR_LIT>""" <EOL> def deadlock ( ) : <EOL> cv = threading . Condition ( ) <EOL> def callback ( * args ) : <EOL> cv . acquire ( ) <EOL> cv . notifyAll ( ) <EOL> cv . release ( ) <EOL> time . sleep ( <NUM_LIT:1> ) <EOL> cv . acquire ( ) <EOL> zookeeper . aget ( handle , "<STR_LIT:/>" , None , callback ) <EOL> cv . wait ( ) <EOL> zookeeper . close ( handle ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
