Skip to content

Commit 05a7d93

Browse files
committed
Prevent floating number precision issue
Some test runs would cause runid to end up with a slightly differing values which caused the tests to fail. An example of failing test is when $runid was observed to be 153.425536363056, but in the database it is stored as '153.42553636305601'. This caused the Attribute to not be found causing some of the tests to fail. I see no need for a long fraction to be used, so truncate it.
1 parent 6b299b5 commit 05a7d93

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

t/api/attribute-tests.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use RT::Test nodata => 1, tests => 34;
55

66

77

8-
my $runid = rand(200);
8+
my $runid = int(rand(200) * 100) / 100;
99

1010
my $attribute = "squelch-$runid";
1111

0 commit comments

Comments
 (0)