TheAlgorithms / C-Sharp

All algorithms implemented in C#.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix BlowfishEncoder or BlowfishEncoderTests

siriak opened this issue · comments

BlowfishEncoder tests fail from time to time for no apparent reason. See test log below for more details:

Failed BlowfishEncoder_Decryption_ShouldWorkCorrectly [105 ms]
  Error Message:
   Expected result to be 
"123456abcd1325[36](https://github.com/TheAlgorithms/C-Sharp/actions/runs/7259358644/job/19776334635#step:6:37)", but 
"1c0dfbe8468a4240" differs near "c0d" (index 1).
  Stack Trace:
     at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
   at FluentAssertions.Execution.TestFrameworkProvider.Throw(String message)
   at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
   at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc)
   at FluentAssertions.Primitives.StringEqualityValidator.ValidateAgainstMismatch()
   at FluentAssertions.Primitives.StringAssertions.Be(String expected, String because, Object[] becauseArgs)
   at Algorithms.Tests.Encoders.BlowfishEncoderTests.BlowfishEncoder_Decryption_ShouldWorkCorrectly() in /home/runner/work/C-Sharp/C-Sharp/Algorithms.Tests/Encoders/BlowfishEncoderTests.cs:line 42


Failed!  - Failed:     1, Passed:  81[39](https://github.com/TheAlgorithms/C-Sharp/actions/runs/7259358644/job/19776334635#step:6:40), Skipped:     0, Total:  81[40](https://github.com/TheAlgorithms/C-Sharp/actions/runs/7259358644/job/19776334635#step:6:41), Duration: 1 m 11 s - Algorithms.Tests.dll (net6.0)

@siriak I see what is causing this issue. The tests are running in parallel and causing it to fail as the _encoder is getting re-initialized... I will create a PR.