openpredictionmarkets / socialpredict

Easy to Deploy Prediction Market Platform
https://github.com/openpredictionmarkets/socialpredict
MIT License
63 stars 11 forks source link

Backend tests fail 1_divideupmarketpoolsharesdbpm_test, wpammarketprobabilities_test #283

Open j4qfrost opened 2 months ago

j4qfrost commented 2 months ago

Currently 1_divideupmarketpoolsharesdbpm_test.go and wpammarketprobabilities_test.go are failing, and it looks like the test scenarios might be the issue?

--- FAIL: TestDivideUpMarketPoolSharesDBPM (0.00s)
    --- FAIL: TestDivideUpMarketPoolSharesDBPM/Prevent_simultaneous_shares_held (0.00s)
        1_divideupmarketpoolsharesdbpm_test.go:14: Prevent simultaneous shares held: expected (3, 1), got (10, 4)
FAIL
FAIL    socialpredict/tests/dbpm        0.286s
--- FAIL: TestCalculateMarketProbabilitiesWPAM (0.00s)
    --- FAIL: TestCalculateMarketProbabilitiesWPAM/Prevent_simultaneous_shares_held (0.00s)
        wpammarketprobabilities_test.go:22: at index 1, expected probability 0.875000, got 0.615385
        wpammarketprobabilities_test.go:22: at index 2, expected probability 0.700000, got 0.571429
    --- FAIL: TestCalculateMarketProbabilitiesWPAM/infinity_avoidance (0.00s)
        wpammarketprobabilities_test.go:22: at index 1, expected probability 0.750000, got 0.545455
        wpammarketprobabilities_test.go:22: at index 3, expected probability 0.250000, got 0.454545
        wpammarketprobabilities_test.go:22: at index 5, expected probability 0.250000, got 0.454545
astrosnat commented 2 months ago

Try pulling from branch /golang123 and let us know the results of the tests...I updated our Go version to 1.23, it was on 1.22.5 before and using an older Go version might have been an issue

(and thanks for your work on GetSetupHandler!)

j4qfrost commented 2 months ago

It looks like a logic error in the test cases. I set appConfig.Economics.MarketCreation.InitialMarketSubsidization to 0 and TestDivideUpMarketPoolSharesDBPM passes. I don't know the math well enough to confirm. It's probably a similar issue for the other tests. The app itself is fine.

pwdel commented 2 months ago

Yes, the test cases should be updated to have the expected outcome that is showing be the same as the actual output.

On Tue, Aug 27, 2024 at 12:00 AM j4qfrost @.***> wrote:

It looks like a logic error in the test cases. I set appConfig.Economics.MarketCreation.InitialMarketSubsidization to 0 and TestDivideUpMarketPoolSharesDBPM passes. I don't know the math well enough to confirm. It's probably a similar issue for the other tests. The app itself is fine.

— Reply to this email directly, view it on GitHub https://github.com/openpredictionmarkets/socialpredict/issues/283#issuecomment-2311637312, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADFQCVMKTB2AWH5ZRNPLGNDZTQIXRAVCNFSM6AAAAABNE2TKICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJRGYZTOMZRGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>