10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

/proc/uptime に依存するアプリの長期稼働のテスト

Posted at

あるアプリで /proc/uptime497 days, 2:27:52.95 を超えた時に不具合が発生しました(1/100秒単位の32ビット符号なし整数の限界)。

検証環境とかで再現させようにも 497 日も連続稼働させないといけないので現実的ではありません・・・

そこで、次のようにダミーのファイルをマウントして無理やり長期稼働させた状況を再現させました。

方法

ダミーの uptime を作成して /proc/uptime にマウントする。

echo "42949672.96 42949672.96" > /root/uptime.dummy
mount --bind /root/uptime.dummy /proc/uptime

元に戻す。

umount /proc/uptime
10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?