From where do we know that one who runs away [during his term] must complete [the missing time]? The verse teaches, "Six years he shall serve." One might think even if he fell ill [he must make up the time]; the verse teaches, "and in the seventh he shall go out" [he leaves regardless]. [Does this mean] he fell ill even all six years? But it was taught: If he was ill three and worked three, he need not complete; if he was ill all six, he must complete. Rav Sheshet said: This refers to one who does needlework [light labor he could still perform]. If he was ill four [years], he is like one who was ill all six, and must complete.
When Illness or Flight Changes a Servant's Term
Yalkut Shimoni on Torah 311:2
מִנַּיִן לְבוֹרֵחַ שֶׁחַיָּב לְהַשְׁלִים, תַּלְמוּד לוֹמַר, שֵׁשׁ שָׁנִים יַעֲבֹד. יָכוֹל אֲפִלּוּ חָלָה, תַּלְמוּד לוֹמַר וּבַשְּׁבִעִת יֵצֵא. חָלָה וַאֲפִלּוּ כָּל שֵׁשׁ, וְהָתַנְיָא, חָלָה שָׁלֹשׁ וְעָבַד שָׁלֹשׁ אֵין חַיָּב לְהַשְׁלִים, חָלָה כָּל שֵׁשׁ חַיָּב לְהַשְׁלִים. אֲמַר רַב שֵׁשֶׁת, בְּעוֹשֵׂה מַעֲשֵׂה מַחַט. חָלָה אַרְבַּע, כְּמִי שֶׁחָלָה כָּל שֵׁשׁ וְחַיָּב לְהַשְׁלִים.