<commit_before>#!/usr/bin/python
from test_common import *
import time

def test_function(opts, mc):

    print "Testing set with expiration"
    if mc.set("a", "aaa", time=5) == 0:
        raise ValueError, "Set failed"

    print "Make sure we can get the element back after short sleep"
    time.sleep(3)
    if mc.get("a") != "aaa":
        raise ValueError("Failure: value can't be found but it's supposed to be")
        
    print "Make sure the element eventually expires"
    time.sleep(2)
    if mc.get("a") != None:
        raise ValueError("Failure: value should have expired but didn't")
        
    print "Done"
    mc.disconnect_all()

if __name__ == "__main__":
    simple_test_main(test_function, make_option_parser().parse(sys.argv), timeout = 7)
<commit_msg>Change expiration test times a little bit to pass under valgrind.<commit_after>#!/usr/bin/python
from test_common import *
import time

def test_function(opts, mc):

    print "Testing set with expiration"
    if mc.set("a", "aaa", time=5) == 0:
        raise ValueError, "Set failed"

    print "Make sure we can get the element back after short sleep"
    time.sleep(1)
    if mc.get("a") != "aaa":
        raise ValueError("Failure: value can't be found but it's supposed to be")
        
    print "Make sure the element eventually expires"
    time.sleep(4)
    if mc.get("a") != None:
        raise ValueError("Failure: value should have expired but didn't")
        
    print "Done"
    mc.disconnect_all()

if __name__ == "__main__":
    simple_test_main(test_function, make_option_parser().parse(sys.argv), timeout = 7)

{'fraction_non_alphanumeric': 0.11629353233830846, 'fraction_numerical': 0.006218905472636816, 'mean_word_length': 3.1901041666666665, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4645024', 'n_tokens_mistral': 518, 'n_tokens_neox': 496, 'n_words': 168}